<asp:Panel ID="pnlOrderCurrent" style="Z-INDEX: 101; LEFT: 23px; POSITION: absolute; TOP: 103px" runat="server" Height="102px" Width="327px"> <table style="height: 98px; width: 324px"> <tr> <td> <asp:Image ID="Image1" runat="server" Height="30px" ImageUrl="~/Images/customer.png" /> </td> <td> <asp:TextBox ID="txtCurrentCustomerCode" Runat="server" Height="12px" Width="70px" AutoPostBack="True" ontextchanged="txtCurrentCustomerCode_TextChanged"> </td> <td> <asp:Image ID="Image2" runat="server" Height="30px" ImageUrl="~/Images/showvalqty.png" /> </td> <td> <asp:TextBox ID="txtCurrentValue" Runat="server" Height="12px" Width="70px" Style="text-align: right"> </td> </tr> <tr> <td> <asp:Image ID="Image3" runat="server" Height="30px" ImageUrl="~/Images/neworder.png" /> </td> <td> <asp:TextBox ID="txtCurrentOrder" Runat="server" Height="12px" Width="70px" > </td> <td> <asp:Image ID="Image4" runat="server" Height="30px" ImageUrl="~/Images/showorder.png" /> </td> <td> <asp:TextBox ID="txtCurrentQty" Runat="server" Height="12px" Width="70px" Style="text-align: right"> </td> </tr> </table>
public void orderitemsummary() { DataTable dtfrqtyval = new DataTable(); connfordata.Open(); SqlCommand cmdfrupdcust = new SqlCommand("sp_SRXO_OrderItemSummary", connfordata); SqlDataAdapter dafrqtyval = new SqlDataAdapter(cmdfrupdcust); cmdfrupdcust.Parameters.AddWithValue("@W113_XMLID", txtCurrentOrder.Text.Trim()); cmdfrupdcust.CommandType = CommandType.StoredProcedure; cmdfrupdcust.ExecuteNonQuery(); dafrqtyval.Fill(dtfrqtyval); connfordata.Close(); double qtyval = Convert.ToDouble(dtfrqtyval.Rows[0]["SumQty"].ToString()); string currentval = dtfrqtyval.Rows[0]["SumVal"].ToString(); int qtyvalcast = (int)Math.Round(qtyval); string[] array = currentval.Split('.'); string first = array[0]; string second = array[1]; string sub = second.Substring(0, 2); string final = (first + "." + sub).Trim(); txtCurrentValue.Text = final; txtCurrentQty.Text = qtyvalcast.ToString(); }
double qtyval = Convert.ToDouble(dtfrqtyval.Rows[0]["SumQty"].ToString()); decimal currentval = Convert.ToDecimal(dtfrqtyval.Rows[0]["SumVal"]); //string currentval = dtfrqtyval.Rows[0]["SumVal"].ToString(); // int qtyvalcast = (int)Math.Round(qtyval); //string[] array = currentval.Split('.'); //string first = array[0]; //string second = array[1]; //string sub = second.Substring(0, 2); //string final = (first + "." + sub).Trim(); txtCurrentValue.Text = Math.Round(currentval, 2).ToString();// final; txtCurrentQty.Text = qtyval.ToString("n"); //qtyvalcast.ToString();
txtCurrentQty.Text = ((int?)qtyval).ToString();
string final = (first + "." + sub).Trim(); txtCurrentValue.Text = final; txtCurrentQty.Text = qtyvalcast.ToString();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)