Example #1
0
    protected void GVInfo_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {
        Label2.Visible      = false;
        LinkButton1.Visible = false;
        lblmsg.Visible      = false;;
        btnapproval.Visible = true;
        lblMessage2.Visible = false;
        txtbox.Visible      = true;
        long k;

        k = Convert.ToInt32(GVInfo.DataKeys[e.NewSelectedIndex].Value);
        i = Convert.ToInt32(GVInfo.DataKeys[e.NewSelectedIndex].Value);
        DataSet ds;
        string  qry = string.Format("SELECT nameofsubdivision,srchallanbookno,srchallanpageno,srchallandate,estimateno,contractorname,nameofestimate,stockitemyype,stockitemcode,stockitemname," +
                                    " goodstype,unit,totalqtyestimate,qtydrawntilldate,qtyindented, recdempname,recdsdoname,lineid,linename,itemtypecode FROM stockissuetable " +
                                    " where itxno={0} ", k);

        ds = DBConnection.fillDataSet(qry);
        if (ds.Tables[0].Rows.Count != 0)
        {
            txtsubdivison.Text            = ds.Tables[0].Rows[0]["nameofsubdivision"].ToString();
            ddestimate.SelectedItem.Text  = ds.Tables[0].Rows[0]["nameofestimate"].ToString();
            ddline.SelectedItem.Text      = ds.Tables[0].Rows[0]["linename"].ToString();
            ddgoodstype.SelectedItem.Text = ds.Tables[0].Rows[0]["goodstype"].ToString();
            dditemname.Items.Clear();
            dditemname.Items.Add(new ListItem(ds.Tables[0].Rows[0]["stockitemname"].ToString(), ds.Tables[0].Rows[0]["stockitemcode"].ToString()));
            //dditemname.SelectedValue = ;
            //dditemname.SelectedItem.Text = ds.Tables[0].Rows[0]["stockitemname"].ToString();
            dditemtype.SelectedItem.Text = ds.Tables[0].Rows[0]["stockitemyype"].ToString();
            //dditemtype.SelectedValue = ds.Tables[0].Rows[0]["itemtypecode"].ToString();
            txtunit.Text       = ds.Tables[0].Rows[0]["unit"].ToString();
            txtqty.Text        = ds.Tables[0].Rows[0]["totalqtyestimate"].ToString();
            txtcontractor.Text = ds.Tables[0].Rows[0]["contractorname"].ToString();
            txtje.Text         = ds.Tables[0].Rows[0]["recdempname"].ToString();
            txtsdo.Text        = ds.Tables[0].Rows[0]["recdsdoname"].ToString();
            txtqtydrwn.Text    = ds.Tables[0].Rows[0]["qtydrawntilldate"].ToString();
            txtsrbook.Text     = ds.Tables[0].Rows[0]["srchallanbookno"].ToString();
            txtsrpage.Text     = ds.Tables[0].Rows[0]["srchallanpageno"].ToString();
            txtsrdate.Text     = Convert.ToDateTime(ds.Tables[0].Rows[0]["srchallandate"]).ToString("dd-MM-yyyy");
            txtqtyindent.Text  = ds.Tables[0].Rows[0]["qtyindented"].ToString();
            txtquantitystore();
        }

        ds.Clear();

        ds.Dispose();
        // txtquantitystore();
        string scmdText = "autovaluenew";

        string[][] param = new string[][] { new string[] { "@iitemcode", dditemname.SelectedValue }
                                            , new string[] { "@istorename", Session["StoreName"].ToString() }
                                            , new string[] { "@goodstatus", ddgoodstype.SelectedItem.Text } };
        DataTable dt = null;

        dt = DBConnection1.executeProcedure(scmdText, param);
        string temp = dt.Rows[0][0].ToString();

        txtissuedvalue.Text = temp;
    }
Example #2
0
    protected void GVInfo_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {
        lblmsg.Visible      = false;
        btndel.Visible      = false;
        btnapproval.Visible = true;
        lblMessage2.Visible = false;
        txtbox.Visible      = true;
        long k;

        k = Convert.ToInt32(GVInfo.DataKeys[e.NewSelectedIndex].Value);
        i = Convert.ToInt32(GVInfo.DataKeys[e.NewSelectedIndex].Value);
        DataSet ds;
        string  qry = string.Format("SELECT rtxno,smonth,syear,scurdate,storename,grbookno,grpageno,grdate,stockstatus, " +
                                    "lineid,linename,subdivid,subdiv,divid,division,firmid,firmname,pstclstore,goodstype, " +
                                    "stockrecddate,stockinspectdate,storechallanno,srwchallanDate,pono,podate,grpid,grgrphead,subgrpid,grsubgrphead,itemno,itype,itemcode,itemname, " +
                                    "unit,qtyrecd,qtyaccepted,rate,subtotal,edpercentage,cesspercentage,highereducesspercentage,total,cstvatpercentage,freight,insurance,field4,grandtotal, " +
                                    "empcode,empname,desg,stockrole,username,field7,field2,estimateno,estid,grtime FROM stockreceipttable " +
                                    " where rtxno={0} "
                                    , k);

        ds = DBConnection.fillDataSet(qry);
        if (ds.Tables[0].Rows.Count != 0)
        {
            txtgrno.Text               = ds.Tables[0].Rows[0]["grbookno"].ToString();
            txtgrpageno.Text           = ds.Tables[0].Rows[0]["grpageno"].ToString();
            txtgrdate.Text             = Convert.ToDateTime(ds.Tables[0].Rows[0]["grdate"]).ToString("dd-MM-yyyy");
            Tr20.Visible               = true;
            Tr21.Visible               = true;
            Tr22.Visible               = true;
            ddline.SelectedItem.Text   = ds.Tables[0].Rows[0]["linename"].ToString();
            ddsubdiv.SelectedItem.Text = ds.Tables[0].Rows[0]["subdiv"].ToString();
            dddiv.SelectedItem.Text    = ds.Tables[0].Rows[0]["division"].ToString();

            ddstatus.SelectedItem.Text = ds.Tables[0].Rows[0]["goodstype"].ToString();
            txtreceiptdate.Text        = ds.Tables[0].Rows[0]["stockrecddate"].ToString();
            txtinspectdate.Text        = ds.Tables[0].Rows[0]["stockinspectdate"].ToString();
            txtsrwno.Text   = ds.Tables[0].Rows[0]["storechallanno"].ToString();
            txtsrwdate.Text = ds.Tables[0].Rows[0]["srwchallanDate"].ToString();
            txtpono.Text    = ds.Tables[0].Rows[0]["pono"].ToString();
            txtpodate.Text  = ds.Tables[0].Rows[0]["podate"].ToString();
            // ddgrouphead.SelectedItem.Text = ds.Tables[0].Rows[0]["grgrphead"].ToString();
            // ddsubgrp.SelectedItem.Text = ds.Tables[0].Rows[0]["grsubgrphead"].ToString();
            dditemtype.SelectedItem.Text = ds.Tables[0].Rows[0]["itype"].ToString();
            //dditemname.SelectedItem.Text = ds.Tables[0].Rows[0]["itemname"].ToString();
            dditemname.Items.Clear();
            dditemname.Items.Add(new ListItem(ds.Tables[0].Rows[0]["itemname"].ToString(), ds.Tables[0].Rows[0]["itemcode"].ToString()));
            txtunit.Text                 = ds.Tables[0].Rows[0]["unit"].ToString();
            txtrquantity.Text            = ds.Tables[0].Rows[0]["qtyrecd"].ToString();
            txtrvalue.Text               = ds.Tables[0].Rows[0]["qtyaccepted"].ToString();
            txtrate.Text                 = ds.Tables[0].Rows[0]["rate"].ToString();
            txtsubtotal.Text             = ds.Tables[0].Rows[0]["subtotal"].ToString();
            txted.Text                   = ds.Tables[0].Rows[0]["edpercentage"].ToString();
            txtcess.Text                 = ds.Tables[0].Rows[0]["cesspercentage"].ToString();
            txtheducess.Text             = ds.Tables[0].Rows[0]["highereducesspercentage"].ToString();
            txttotal.Text                = ds.Tables[0].Rows[0]["total"].ToString();
            txtvat.Text                  = ds.Tables[0].Rows[0]["cstvatpercentage"].ToString();
            txtfreight.Text              = ds.Tables[0].Rows[0]["freight"].ToString();
            txtprcvar.Text               = ds.Tables[0].Rows[0]["field4"].ToString();
            txtgrandtotal.Text           = ds.Tables[0].Rows[0]["grandtotal"].ToString();
            txtempcode.Text              = ds.Tables[0].Rows[0]["empcode"].ToString();
            txtempname.Text              = ds.Tables[0].Rows[0]["empname"].ToString();
            txtdesg.Text                 = ds.Tables[0].Rows[0]["desg"].ToString();
            ddestimate.SelectedItem.Text = ds.Tables[0].Rows[0]["estimateno"].ToString();
            txtgrno.Text                 = "";
            txtgrpageno.Text             = "";
            txtgrdate.Text               = "dd-mm-yyyy";
            txtreceiptdate.Text          = "dd-mm-yyyy";
            txtinspectdate.Text          = "dd-mm-yyyy";
        }
        ds.Clear();
        ds.Dispose();
        Proceed.Text = "Update";
        can.Visible  = false;
        readonlytext();
        grouphead();
        subgrouphead();

        string scmdText = "autovaluenew";

        string[][] param = new string[][] { new string[] { "@iitemcode", dditemname.SelectedValue }
                                            , new string[] { "@istorename", Session["StoreName"].ToString() }
                                            , new string[] { "@goodstatus", ddstatus.SelectedItem.Text } };
        DataTable dt = null;

        dt = DBConnection1.executeProcedure(scmdText, param);

        if (dt.Rows.Count > 0)
        {
            string temp = dt.Rows[0][0].ToString();
            txtrate.Text = temp;
        }
        else
        {
            txtrate.Text = "0.000";
        }
    }