Ejemplo n.º 1
0
 protected void rbtbookset_CheckedChanged(object sender, EventArgs e)
 {
     txtMRCode.Visible      = false;
     lblmrcode.Visible      = false;
     lblbookset.Visible     = true;
     txtMRCode.Text         = "";
     SalesmanLedger.Visible = false;
     DDLSelectSet.Visible   = true;
     DDLSelectSet.Focus();
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["ChetanaCompanyName"] != "" || Session["ChetanaCompanyName"] != null)
        {
            if (Session["FY"] != "" || Session["FY"] != null)
            {
                strChetanaCompanyName = Session["ChetanaCompanyName"].ToString();
                strFY = Session["FY"].ToString();
            }
            else
            {
                Session.Clear();
            }
            //Response.Write(strFY);
        }
        if (!Page.IsPostBack)
        {
            ViewState["srate"] = "";
            SetView();
            GetValidation(3, Convert.ToInt32(Session["Role"]));
            string grp = "BookSet";
            DDLSelectSet.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown(grp, "DropDown");
            DDLSelectSet.DataBind();
            DDLSelectSet.Items.Insert(0, new ListItem("-Select book set-", "0"));
            string std = "Standard";
            DDlstandard.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown(std, "DropDown");
            DDlstandard.DataBind();
            DDlstandard.Items.Insert(0, new ListItem("-STD-", "0"));
            txtdocDate.Text  = DateTime.Now.ToString("dd/MM/yyyy");
            txtChalDate.Text = DateTime.Now.ToString("dd/MM/yyyy");
            txtOrdDate.Text  = DateTime.Now.ToString("dd/MM/yyyy");
            txtorder.Focus();
            Session["tempBookData"] = null;

            // btncancel.Visible = false;
            //Session["tempBookData"] = null;
        }
        if (add)
        {
            btn_Save.Enabled = true;
        }
        if (!view)
        {
            BtnGetSpecimanDetails.Enabled = false;
        }
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["ChetanaCompanyName"] != "" || Session["ChetanaCompanyName"] != null)
        {
            if (Session["FY"] != "" || Session["FY"] != null)
            {
                strChetanaCompanyName = Session["ChetanaCompanyName"].ToString();
                strFY = Session["FY"].ToString();
            }
            else
            {
                Session.Clear();
            }
        }
        if (!Page.IsPostBack)
        {
            GetValidation(3, Convert.ToInt32(Session["Role"]));
            ModalPopUpDocNum.Show();
            TxtDocNo.Focus();

            string grp = "BookSet";
            DDLSelectSet.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown(grp, "DropDown");
            DDLSelectSet.DataBind();
            DDLSelectSet.Items.Insert(0, new ListItem("-Select book set-", "0"));

            string std = "Standard";
            DDLstandard.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown(std, "DropDown");
            DDLstandard.DataBind();
            DDLstandard.Items.Insert(0, new ListItem("-STD-", "0"));
            //   txtdocDate.Text = DateTime.Now.ToString(sDateFormat);
            txtChalDate.Text = DateTime.Now.ToString(sDateFormat);
            //  txtDeliverydte.Text = DateTime.Now.ToString(sDateFormat);
            //    txtOrdDate.Text = DateTime.Now.ToString(sDateFormat);
            //txtorder.Focus();
            Session["tempDCData"] = null;
            // Openpopup(2).;
            // btncancel.Visible = false;
            //Session["tempDCData"] = null;
            Bindcustomer();
            // DCMaster.Get_Transporter(custcode);
            lblZoneCode.Visible = false;
            DDLZone.Visible     = false;
        }
    }
Ejemplo n.º 4
0
    protected void txtbankdet_TextChanged(object sender, EventArgs e)
    {
        string BankCode = txtbankdet.Text.ToString().Split(':')[0].Trim();


        DataTable dt = new DataTable();

        dt = DCMaster.Get_Name(BankCode, "Bank").Tables[0];
        if (dt.Rows.Count != 0)
        {
            txtbankdet.Text  = BankCode;
            lblbankname.Text = Convert.ToString(dt.Rows[0]["BankName"]);
            DDLSelectSet.Focus();
        }


        else
        {
            lblbankname.Text = "No such Bank code";
            txtbankdet.Focus();
            txtbankdet.Text = "";
        }
    }
    protected void btngetset_Click(object sender, EventArgs e)
    {
        if (ViewState["srate"].ToString() == "")
        {
            MessageBox("Kindly select Employee");
            //txtsalemanCode.Focus();
            ViewState["srate"] = "";
        }
        else
        {
            setStateGridview();
            Qty = Convert.ToString(txtsetqty.Text.Trim());
            if (Qty == "" || Qty == "0")
            {
                Qty  = "1";
                rqty = "1";
            }
            if (txtsetqty.Text != "")
            {
                rqty = Convert.ToString(txtsetqty.Text);
                Qty  = Convert.ToString(txtsetqty.Text);
            }
            if (txtGCN.Text != "")
            {
                grdBookDetails.Columns[7].Visible = true;
                grdBookDetails.Columns[8].Visible = true;
                // grdBookDetails.Columns[10].Visible = false;
            }
            else
            {
                grdBookDetails.Columns[7].Visible = false;
                grdBookDetails.Columns[8].Visible = false;
                //  grdBookDetails.Columns[10].Visible = true;
            }
            if (DDLSelectSet.SelectedValue == "0")
            {
                loder("Kindly select bookset");
                DDLSelectSet.Focus();
            }
            else
            {
                try
                {
                    DataTable bookdescription = new DataTable();
                    bookdescription = BookSetDetails.GetDescription_Of_bookset((Convert.ToInt32(DDLSelectSet.SelectedItem.Value)), "Specimen").Tables[0];
                    Description     = bookdescription.Rows[0]["Description"].ToString();


                    DataTable dt1 = new DataTable();
                    if (Session["tempBookData"] != null)
                    {
                        Session["tempBookData"] = fillTempBookData("", "set");
                        dt1 = (DataTable)Session["tempBookData"];
                    }
                    else
                    {
                        Session["tempBookData"] = fillTempBookData("", "set");
                        dt1 = (DataTable)Session["tempBookData"];
                    }
                    foreach (GridViewRow row in grdBookDetails.Rows)
                    {
                        ((Label)row.FindControl("lblavailable")).Visible = false;
                    }
                    grdBookDetails.DataSource = dt1;
                    grdBookDetails.DataBind();
                    loder(DDLSelectSet.SelectedItem.Text + "(bookset) added successfully");
                    string jv1 = "clearBookset()";
                    ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "as", jv1, true);
                }
                catch
                {
                }
            }
        }
    }
    protected void btngetset_Click(object sender, EventArgs e)
    {
        //Validate Bookset
        if (DDLSelectSet.SelectedValue != "0")
        {
            Qty = Convert.ToString(txtsetqty.Text.Trim());
            if (Qty != "" && Qty != "0")
            {
                DataTable dt = Other_Z.OtherBAL.GetValidate_Speciman(Convert.ToInt32(DDLSelectSet.SelectedItem.Value), Qty, txtsalemanCode.Text.Trim(), Convert.ToInt32(strFY), "", "").Tables[0];

                if (dt.Rows.Count > 0)
                {
                    if (Convert.ToInt32(dt.Rows[0][0]) >= 0)
                    {
                    }
                    else
                    {
                        //MessageBox("Out of Limit Book Set " + DDLSelectSet.SelectedItem);
                        MessageBox("Out of Limit Book Set" + DDLSelectSet.SelectedItem + "  " + " Total Limit(" + dt.Rows[0][1] + ")" + "  " + " Remaining Limit(" + dt.Rows[0][2] + ")");
                        txtsetqty.Text = "";
                        txtsetqty.Focus();
                        return;
                    }
                }
                else
                {
                    MessageBox("Please Set BookSet Limit " + DDLSelectSet.SelectedItem);
                    txtsetqty.Text = "";
                    txtsetqty.Focus();
                    return;
                }
            }
            else
            {
                MessageBox("Please Enter Quntity");
                txtsetqty.Focus();
                return;
            }
        }
        else
        {
            MessageBox("Please Select Book Set");
            DDLSelectSet.Focus();
            return;
        }

        if (ViewState["srate"].ToString() == "")
        {
            MessageBox("Kindly select Employee");
            txtsalemanCode.Focus();
            ViewState["srate"] = "";
        }
        else
        {
            setStateGridview();
            Qty = Convert.ToString(txtsetqty.Text.Trim());
            if (Qty == "" || Qty == "0")
            {
                Qty  = "1";
                rqty = "1";
            }
            if (txtsetqty.Text != "")
            {
                rqty = Convert.ToString(txtsetqty.Text);
                Qty  = Convert.ToString(txtsetqty.Text);
            }
            if (txtdoc.Text != "")
            {
                grdBookDetails.Columns[7].Visible = true;
                grdBookDetails.Columns[8].Visible = true;
                // grdBookDetails.Columns[10].Visible = false;
            }
            else
            {
                grdBookDetails.Columns[7].Visible = false;
                grdBookDetails.Columns[8].Visible = false;
                //  grdBookDetails.Columns[10].Visible = true;
            }
            if (DDLSelectSet.SelectedValue == "0")
            {
                loder("Kindly select bookset");
                DDLSelectSet.Focus();
            }
            else
            {
                try
                {
                    DataTable bookdescription = new DataTable();
                    bookdescription = BookSetDetails.GetDescription_Of_bookset((Convert.ToInt32(DDLSelectSet.SelectedItem.Value)), "Specimen").Tables[0];
                    Description     = bookdescription.Rows[0]["Description"].ToString();


                    DataTable dt1 = new DataTable();
                    if (Session["tempBookData"] != null)
                    {
                        Session["tempBookData"] = fillTempBookData("", "set");
                        dt1 = (DataTable)Session["tempBookData"];
                    }
                    else
                    {
                        Session["tempBookData"] = fillTempBookData("", "set");
                        dt1 = (DataTable)Session["tempBookData"];
                    }
                    foreach (GridViewRow row in grdBookDetails.Rows)
                    {
                        ((Label)row.FindControl("lblavailable")).Visible = false;
                    }
                    grdBookDetails.DataSource = dt1;
                    grdBookDetails.DataBind();
                    loder(DDLSelectSet.SelectedItem.Text + "(bookset) added successfully");
                    string jv1 = "clearBookset()";
                    ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "as", jv1, true);
                }
                catch
                {
                }
            }
        }
    }
Ejemplo n.º 7
0
    protected void btngetset_Click(object sender, EventArgs e)
    {
        if (srate == "")
        {
            MessageBox("Kindly select Customer");
            txtcustomer.Focus();
        }
        else
        {
            if (txtDeliverydte.Text != "")
            {
                //if (Convert.ToDateTime(Convert.ToDateTime(txtDeliverydte.Text).ToShortDateString()) < Convert.ToDateTime(DateTime.Now.ToShortDateString()))
                //{
                setStateGridview();
                AddRate();
                Qty  = Convert.ToString(txtsetqty.Text.Trim());
                rqty = Convert.ToString(txtbookqty.Text.Trim());
                string date = txtDeliverydte.Text.Split('/')[1] + "/" + txtDeliverydte.Text.Split('/')[0] + "/" + txtDeliverydte.Text.Split('/')[2];

                Delidate = Convert.ToDateTime(date);

                if (Qty == "" || Qty == "0")
                {
                    Qty  = "1";
                    rqty = "1";
                }
                if (txtsetqty.Text != "")
                {
                    rqty = Convert.ToString(txtsetqty.Text.Trim());
                    Qty  = Convert.ToString(txtsetqty.Text.Trim());
                }
                if (txtdoc.Text != "")
                {
                    grdBookDetails.Columns[5].Visible = true;
                    grdBookDetails.Columns[4].Visible = true;
                    // grdBookDetails.Columns[10].Visible = false;
                }
                else
                {
                    grdBookDetails.Columns[5].Visible = false;
                    grdBookDetails.Columns[4].Visible = false;
                    //  grdBookDetails.Columns[10].Visible = true;
                }
                if (DDLSelectSet.SelectedValue == "0")
                {
                    loder("Kindly select bookset");
                    DDLSelectSet.Focus();
                }
                else
                {
                    try
                    {
                        DataTable dt1 = new DataTable();
                        if (Session["tempDCData"] != null)
                        {
                            Session["tempDCData"] = fillTempBookData("", "set");
                            dt1 = (DataTable)Session["tempDCData"];
                        }
                        else
                        {
                            Session["tempDCData"] = fillTempBookData("", "set");
                            dt1 = (DataTable)Session["tempDCData"];
                        }
                        foreach (GridViewRow row in grdBookDetails.Rows)
                        {
                            ((Label)row.FindControl("lblavailable")).Visible = false;
                        }
                        grdBookDetails.DataSource = dt1;
                        grdBookDetails.DataBind();
                        loder(DDLSelectSet.SelectedItem.Text + "(bookset) added successfully");
                        string jv1 = "clearBookset()";
                        ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "as", jv1, true);
                        DDLSelectSet.Focus();
                    }
                    catch
                    {
                    }
                }
                //}
                //else {
                //    MessageBox("Delivery date should be more than todays date");
                //    txtDeliverydte.Focus();
                //}
            }
            else
            {
                MessageBox("Select delivery date");
                txtDeliverydte.Focus();
            }
        }
    }