Example #1
0
    protected void btnPrint_Click(object sender, EventArgs e)
    {
        ((Button)(sender)).Enabled = false;
        SpecimenConfirmQtyDetails _objSpecimenConfirmQtyDetails = new SpecimenConfirmQtyDetails();
        Specimen _objspecimen = new Specimen();


        try
        {
            _objSpecimenConfirmQtyDetails.IsPrintInvoice = true;
            _objSpecimenConfirmQtyDetails.CreatedBy      = Session["UserName"].ToString();
            _objSpecimenConfirmQtyDetails.SubDocId       = Convert.ToDecimal(((Button)(sender)).CommandArgument.Trim());
            _objSpecimenConfirmQtyDetails.Save_Specimen_PrintInvoiceDetails();
            ((Button)(sender)).BackColor = System.Drawing.Color.Red;
            ((Button)(sender)).ForeColor = System.Drawing.Color.White;
            ((Button)(sender)).Enabled   = true;
            ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "window", "f_open_window_max('print/PrintInvoiceReport.aspx?d=" + txtDocno.Text.Trim() + "&sd=" + ((Button)(sender)).CommandArgument.Trim() + "')", true);
        }


        catch (Exception ex)
        {
            MessageBox(ex.Message.ToString());
            ((Button)(sender)).Enabled = true;
        }
        //}
    }
Example #2
0
    protected void btnconfirm_Click(object sender, EventArgs e)
    {
        btnconfirm.Enabled = false;
        Auth     = Specimen.Get_DocumentNum_Authentication(Convert.ToInt32(txtdocno.Text));
        SubDocNo = Convert.ToDecimal(SpecimenConfirmQtyDetails.Get_SpecimenDetails_SubDocNo_ByDocID(Convert.ToInt32(txtdocno.Text)).Rows[0][0].ToString());
        if (Auth)
        {
            MessageBox("Document no is not available");
            txtdocno.Focus();
        }

        else
        {
            SpecimenConfirmQtyDetailsNew _objSpecimenNew = new SpecimenConfirmQtyDetailsNew();


            SpecimenConfirmQtyDetails _objSpecimenConfirmQtyDetails = new SpecimenConfirmQtyDetails();
            //Specimen _objspecimen = new Specimen();
            //SpecimentoGodown _objSpecimentoGodown = new SpecimentoGodown();
            int DocId = 0;
            try
            {
                XmlDocument doc         = new XmlDocument();
                XmlNode     objrootnode = doc.CreateElement("rt");

                foreach (GridViewRow Row in grdconfirm.Rows)
                {
                    XmlNode surootnode = doc.CreateElement("i");

                    XmlNode sid = doc.CreateElement("sid");
                    sid.InnerText = ((Label)Row.FindControl("lblspecidatils")).Text.Trim();
                    surootnode.AppendChild(sid);


                    string Qty = ((TextBox)Row.FindControl("lblavailable")).Text.Trim();
                    if (Qty == "")
                    {
                        Qty = "0";
                    }
                    XmlNode aq = doc.CreateElement("aq");
                    aq.InnerText = Qty;
                    surootnode.AppendChild(aq);
                    objrootnode.AppendChild(surootnode);
                    _objSpecimenNew.Doc_no = Convert.ToInt32(((Label)Row.FindControl("lbldocNo")).Text.Trim());
                }
                _objSpecimenNew.EmpId    = txtempc.Text.Trim();
                _objSpecimenNew.SubDocNo = SubDocNo;
                _objSpecimenNew.XML      = objrootnode.OuterXml.ToString();
                _objSpecimenNew.Save();

                //_objSpecimenConfirmQtyDetails.Save();
                //_objSpecimentoGodown.EmpID=
                //_objSpecimentoGodown.CreatedBy = Session["UserName"].ToString();
                //_objSpecimentoGodown.SaveGodown();

                //_objspecimen.DocNo = DocId;
                //_objspecimen.IsConfirm = true;
                //_objspecimen.IsApproved = false;
                //_objspecimen.IsCanceled = false;
                //_objspecimen.update();
                grdconfirm.DataBind();
                MessageBox("DC Confirm successfully for document no. " + txtdocno.Text);
                docno.InnerHtml = "Last confirm doc no. : " + docno.InnerHtml;
                callreseter();
                txtempc.Text       = "";
                lblEmpName.Text    = "";
                txtempc.Visible    = false;
                lblEmpName.Visible = false;
                lblemp.Visible     = false;
                btnconfirm.Enabled = true;
                btnPrint.Visible   = false;
                string jv = "document.getElementById('ctl00_ContentPlaceHolder1_uc_ConfirmDC1_btnconfirm').style.display='none';";
                ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "a", jv, true);

                upOrderNO.Update();
            }

            catch (Exception ex)
            {
                MessageBox(ex.Message.ToString());
            }
        }
    }
Example #3
0
    protected void RepDetailsConfirm_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        bool Auth = Specimen.Get_DocumentNum_Authentication(Convert.ToInt32(txtDocno.Text));

        if (Auth)
        {
            MessageBox("Document no is not available");
            txtDocno.Focus();
        }
        else
        {
            GridView grd = (GridView)e.Item.FindControl("grdapproval");
            updateRecords(grd, docno.InnerHtml.Trim(), e.CommandArgument.ToString().Trim());
            SpecimenConfirmQtyDetails _objSpecimenConfirmQtyDetails = new SpecimenConfirmQtyDetails();
            Specimen _objspecimen = new Specimen();
            SpecimenConfirmQtyDetails _objSpecimenFT = new SpecimenConfirmQtyDetails();
            try
            {
                decimal subconfirmdoc = Convert.ToDecimal(e.CommandArgument.ToString().Trim());
                _objSpecimenConfirmQtyDetails.IsCreateInvoice  = true;
                _objSpecimenConfirmQtyDetails.CreatedInvoiceBy = userName;
                _objSpecimenConfirmQtyDetails.SubDocNo         = Convert.ToDecimal(e.CommandArgument.ToString().Trim());
                _objspecimen.DocNo = Convert.ToInt32(txtDocno.Text);
                _objSpecimenConfirmQtyDetails.Transporter = ((TextBox)e.Item.FindControl("txtTransporter")).Text;
                _objSpecimenConfirmQtyDetails.LrNo        = ((TextBox)e.Item.FindControl("txtlrno")).Text;
                _objSpecimenConfirmQtyDetails.Bundles     = ((TextBox)e.Item.FindControl("txtbundles")).Text;
                TextBox txtdateabc = (TextBox)e.Item.FindControl("txtdateabc");
                string  date1;
                if (txtdateabc.Text == "")
                {
                    date1 = null;
                }
                else
                {
                    date1 = txtdateabc.Text.Split('/')[1] + "/" + txtdateabc.Text.Split('/')[0] + "/" + txtdateabc.Text.Split('/')[2];
                }
                _objSpecimenConfirmQtyDetails.InvoiceDate = Convert.ToDateTime(date1);
                _objSpecimenConfirmQtyDetails.SaveConfirmDetails();
                Cleardata();
                // stDS = new DataSet();
                docno.InnerHtml = txtDocno.Text.Trim();
                // stDS = SpecimanDetails.Get_SubDocId_And_ItsRecords_By_DocNo(Convert.ToInt32(txtDocno.Text), "approved");
                // ViewState["staticDS"] = stDS;
                //RepDetailsConfirm.DataSource = stDS.Tables[0];
                // RepDetailsConfirm.DataBind();

                MessageBox("Invoice No. " + subconfirmdoc + " Successfully updated!");
                docno.InnerHtml = "Last confirm doc no. : " + subconfirmdoc;

                if (Rptrpending.Items.Count == 1)
                {
                    Rptrpending.DataSource = Specimen.Get_ApprovedDocNo();
                    Rptrpending.DataBind();
                    //updateapprove.Update();
                }
                if (RepDetailsConfirm.Items.Count == 0)
                {
                    Rptrpending.DataSource = Specimen.Get_ApprovedDocNo();
                    Rptrpending.DataBind();
                    //upDocNo.Update();
                    docno.InnerHtml = "";
                    //lblcustname.InnerHtml = "";
                    lblempname1.InnerHtml = "";
                    //updateapprove.Update();
                }

                //updateapprove.Update();
            }
            catch (Exception ex)
            {
                MessageBox(ex.Message.ToString());
            }
        }
    }