public void FillGrid(string mpurid, string dat)
        {
            try
            {
                //q = " select * from  v_diffRat  where MPurDate <= '" + dat + "' and MPurID ='" + mpurid + "' and  CompanyId = '" + Session["CompanyID"] + "' and BranchId= '" + Session["BranchID"] + "'";
                dt_ = new DataTable();
                //dt_ = DBConnection.GetQueryData(q);
                using (var cmd = new SqlCommand("sp_currdiff", con))
                    using (var da = new SqlDataAdapter(cmd))
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.AddWithValue("@MPurID", PURID.Trim());
                        da.Fill(dt_);
                    }

                if (dt_.Rows.Count > 0)
                {
                    GVDIff.DataSource = dt_;
                    GVDIff.DataBind();

                    lbl_dat.Text     = dt_.Rows[0]["MPurDate"].ToString();
                    lbl_trans.Text   = dt_.Rows[0]["Transport"].ToString();
                    lblotheramt.Text = dt_.Rows[0]["Otheramt"].ToString();
                    lbl_exchrat.Text = dt_.Rows[0]["Exchange_Rat"].ToString();

                    // Rate in PK

                    //GTotal = 0;

                    //for (int j = 0; j < GVDIff.Rows.Count; j++)
                    //{
                    //    Label total = (Label)GVDIff.Rows[j].FindControl("lb_ratinpk");
                    //    GTotal += Convert.ToSingle(total.Text);
                    //}


                    // Rate in Other Currencies

                    //GTotal = 0;

                    //for (int j = 0; j < GVDIff.Rows.Count; j++)
                    //{
                    //    Label total = (Label)GVDIff.Rows[j].FindControl("lb_purpric");
                    //    GTotal += Convert.ToSingle(total.Text);
                    //}
                }
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        public void FillGrid(string mpurid, string dat)
        {
            try
            {
                q   = " select * from  v_diffRat  where MPurDate <= '" + dat + "' and MPurID ='" + mpurid + "' and  CompanyId = '" + Session["CompanyID"] + "' and BranchId= '" + Session["BranchID"] + "'";
                dt_ = new DataTable();
                dt_ = DBConnection.GetQueryData(q);

                if (dt_.Rows.Count > 0)
                {
                    GVDIff.DataSource = dt_;
                    GVDIff.DataBind();

                    lbl_dat.Text     = dt_.Rows[0]["MPurDate"].ToString();
                    lbl_trans.Text   = dt_.Rows[0]["Transport"].ToString();
                    lblotheramt.Text = dt_.Rows[0]["Otheramt"].ToString();
                    lbl_exchrat.Text = dt_.Rows[0]["Exchange_Rat"].ToString();

                    // Rate in PK

                    //GTotal = 0;

                    //for (int j = 0; j < GVDIff.Rows.Count; j++)
                    //{
                    //    Label total = (Label)GVDIff.Rows[j].FindControl("lb_ratinpk");
                    //    GTotal += Convert.ToSingle(total.Text);
                    //}


                    // Rate in Other Currencies

                    //GTotal = 0;

                    //for (int j = 0; j < GVDIff.Rows.Count; j++)
                    //{
                    //    Label total = (Label)GVDIff.Rows[j].FindControl("lb_purpric");
                    //    GTotal += Convert.ToSingle(total.Text);
                    //}
                }
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 3
0
        public void FillGrid(string dat)
        {
            try
            {
                q = " select * from  v_diffRat  where MPurDate = '" + dat + "' and CompanyId = '" + Session["CompanyID"] + "' and BranchId= '" + Session["BranchID"] + "'";

                dt_ = new DataTable();
                dt_ = DBConnection.GetQueryData(q);

                if (dt_.Rows.Count > 0)
                {
                    GVDIff.DataSource = dt_;
                    GVDIff.DataBind();

                    lbl_dat.Text = dt_.Rows[0]["MPurDate"].ToString();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public void FillGrid(string dat)
        {
            try
            {
                using (var cmd = new SqlCommand("sp_currdiff", con))
                    using (var da = new SqlDataAdapter(cmd))
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.AddWithValue("@MPurID", PURID.Trim());
                        da.Fill(dt_);
                    }

                if (dt_.Rows.Count > 0)
                {
                    GVDIff.DataSource = dt_;
                    GVDIff.DataBind();
                }

                //q = " select * from  v_diffRat  where MPurDate = '" + dat + "' and CompanyId = '" + Session["CompanyID"] + "' and BranchId= '" + Session["BranchID"] + "'";

                //dt_ = new DataTable();
                //dt_ = DBConnection.GetQueryData(q);

                //if (dt_.Rows.Count > 0)
                //{
                //    GVDIff.DataSource = dt_;
                //    GVDIff.DataBind();

                //    lbl_dat.Text = dt_.Rows[0]["MPurDate"].ToString();
                //}
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }