protected void lblBookType_TextChanged(object sender, EventArgs e)
    {
        TextBox     txtbooktype = (TextBox)sender;
        GridViewRow gvRow       = (GridViewRow)txtbooktype.Parent.Parent;
        Label       lblTotalRs  = (Label)gvRow.FindControl("bookId");
        TextBox     txtFromQty  = (TextBox)gvRow.FindControl("lblFromQty");
        string      BookCode    = txtbooktype.Text.Split(':')[0].Trim();

        txtbooktype.Text = BookCode;
        if (txtbooktype.Text != "")
        {
            Other_Z.OtherBAL ObjBAL = new Other_Z.OtherBAL();
            DataSet          ds     = ObjBAL.GetBookIdWithBookType(BookCode, Convert.ToInt32(Session["FY"]), "booktype");
            if (ds.Tables[0].Rows.Count > 0)
            {
                lblTotalRs.Text = ds.Tables[0].Rows[0][0].ToString();
                txtFromQty.Focus();
            }
            else
            {
                MessageBox("Invalid book name please try again");
                txtbooktype.Text = "";
                txtbooktype.Focus();
                return;
            }
        }
        else
        {
            MessageBox("Please enter book code");
            txtbooktype.Text = "";
            txtbooktype.Focus();
            return;
        }
    }
예제 #2
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (txtUser.Text != "")
     {
         StringBuilder sb          = new StringBuilder();
         string        SuperzoneId = "";
         string        UserName    = txtUser.Text.Split(':')[0].ToString();
         foreach (GridViewRow item in usergrid.Rows)
         {
             CheckBox chk = (CheckBox)item.FindControl("ChkVal");
             if (chk.Checked)
             {
                 SuperzoneId = Convert.ToInt32(((Label)item.FindControl("chkid")).Text).ToString();
                 sb.Append(SuperzoneId + ",");
             }
         }
         if (sb.ToString() != "")
         {
             Other_Z.OtherBAL ObjDal = new Other_Z.OtherBAL();
             ObjDal.Idv_Chetana_UserTicketMap_Save(UserName, sb.ToString(), Convert.ToInt32(FY), Session["Username"].ToString(), "", "", "", "", "", "", "");
             Message("Record save successfully");
             txtUser.Text = "";
             txtUser.Focus();
         }
         else
         {
             Message("Please select super zone ");
             return;
         }
     }
     Message("Please enter user name");
     txtUser.Focus();
     return;
 }
예제 #3
0
    protected void btnUpload_Click(object sender, EventArgs e)
    {
        XmlDocument doc   = new XmlDocument();
        XmlNode     inode = doc.CreateElement("f");
        XmlNode     fnode = doc.CreateElement("r");

        foreach (GridViewRow row in grdImportCust.Rows)
        {
            XmlNode element = doc.CreateElement("i");

            inode           = doc.CreateElement("c");
            inode.InnerText = ((Label)row.FindControl("lblcode")).Text.ToString();
            element.AppendChild(inode);

            inode           = doc.CreateElement("s");
            inode.InnerText = ((Label)row.FindControl("lblsplitdc")).Text.ToString();
            element.AppendChild(inode);

            fnode.AppendChild(element);
        }

        Other_Z.OtherBAL objBal = new Other_Z.OtherBAL();
        objBal.UpdateCustomermaster(fnode.OuterXml, "", "", "");
        MessageBox("Data Upload Success");
        grdpanl.Visible   = false;
        btnUpload.Visible = false;
    }
예제 #4
0
    private void BindReport()
    {
        StringBuilder objste = new StringBuilder("-");

        try
        {
            Other_Z.OtherBAL ObjDal = new Other_Z.OtherBAL();
            DoLog(objste, "Start");
            DataSet   dsSuperZones = OtherNewClass.AutoMail.AutoMailParams("missingreceipts", "", "", "", "", "", "", "", "");
            DataTable dtsz         = dsSuperZones.Tables[0];
            DoLog(objste, "Get Super Zones Count >> " + dtsz.Rows.Count.ToString());
            DataTable dt = dsSuperZones.Tables[1];
            DoLog(objste, "Get Dates Count >> " + dt.Rows.Count.ToString());
            DataTable dtmaildesc = dsSuperZones.Tables[2];
            DoLog(objste, "Get Mail setting Count >> " + dtmaildesc.Rows.Count.ToString());
            string FirstPath  = string.Empty;
            string SecondPath = string.Empty;
            DoLog(objste, "Generating 1 File");
            FirstPath  = "../AutoEmailAttachment/MissingReceipts/" + Convert.ToDateTime(dt.Rows[0]["todate"].ToString()).ToString("MM_dd_yyyy_HH_MM") + "/" + DateTime.Now.ToString("MM_dd_yyyy_HH_MM") + "/";
            SecondPath = "";
            DirectoryManagement(FirstPath);
            DataSet ds = ObjDal.Idv_Chetana_Missing_UnuseReceiptNo(dt.Rows[0]["fromdate"].ToString(), dt.Rows[0]["todate"].ToString(), Convert.ToInt32(dt.Rows[0]["fy"].ToString()), Convert.ToInt32("0"), Convert.ToInt32("0"), Convert.ToInt32("0"), Convert.ToInt32("0"), "", "email");
            DoLog(objste, "Main Dataset >> ");
            Response.Write(generatefiles(ds, dtsz, dt.Rows[0]["fromdate"].ToString(), dt.Rows[0]["todate"].ToString(), FirstPath, dtmaildesc));
            DoLog(objste, "Wrote Data >> ");
        }
        catch (Exception wex)
        {
            Response.Write("Error >> " + DoLog(objste, "Error >> " + wex.Message).ToString());
        } Response.End();
    }
예제 #5
0
    protected void BindStatus()
    {
        Other_Z.OtherBAL ObjDal = new Other_Z.OtherBAL();
        DataSet          DSX    = ObjDal.BindStatus();
        DataTable        dt     = new DataTable();

        DSX.Tables.Add(dt);
        InqSatatus.DataSource    = DSX;
        InqSatatus.DataTextField = "Status_Name";
        InqSatatus.DataBind();
        InqSatatus.Items.Insert(0, new ListItem("Select", "NA"));
    }
예제 #6
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        int OutNo = 0;

        // We were using CustomerDetails but no more using it.
        //CustomerDetails obj=new CustomerDetails();
        //BankPayment obj = new BankPayment();
        Other_Z.OtherBAL             ObjBal = new Other_Z.OtherBAL();
        Other_Z.OtherBAL.SaveBankPay obj    = new Other_Z.OtherBAL.SaveBankPay();
        foreach (GridViewRow row in gdGeneral.Rows)
        {
            if (Convert.ToDecimal(((TextBox)row.FindControl("txtAmount")).Text) > 0)
            {
                try
                {
                    obj.BankPaymentID  = 0;
                    obj.BankCode       = "";
                    obj.Documentno     = 0;
                    obj.Serialno       = 1;
                    obj.DocumentDate   = DateTime.Now;
                    obj.AccountCode    = ((Label)row.FindControl("lblCode")).Text;
                    obj.PersonInCharge = "";
                    obj.ReportCode     = "";
                    obj.Cash_Cheque_DD = "";
                    obj.Cheque_DD_NO   = "";
                    // obj.Type = txtType.Text.Trim();
                    obj.Type           = "";
                    obj.Amount         = Convert.ToDecimal(((TextBox)row.FindControl("txtAmount")).Text);
                    obj.DrawnOn        = "";
                    obj.Remarks        = "debit";
                    obj.IsActive       = true;
                    obj.CreatedBy      = Session["UserName"].ToString();
                    obj.UpdatedBy      = "";
                    obj.strFY          = Convert.ToInt32(strFY);
                    obj.Paymode        = "AddcomisionDebit";
                    obj.IsChequeBounce = false;
                    //When Remarks = "debit", in sp we will insert value in Amount field to AddComDebit column in column
                    ObjBal.SaveBankPayment(obj, out OutNo);
                }
                catch (Exception ex)
                {
                    throw;
                }
            }
        }
        ShowDetails();
        MessageBox("Record updated sucessfully..." + OutNo.ToString());
    }
예제 #7
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        XmlDocument doc    = new XmlDocument();
        XmlNode     finode = doc.CreateElement("r");
        XmlNode     inode  = doc.CreateElement("f");
        bool        flag   = false;

        foreach (GridViewRow item in grdBookset.Rows)
        {
            XmlNode element = doc.CreateElement("i");
            string  limit   = ((TextBox)item.FindControl("lbllimit")).Text.ToString();
            if (limit != "")
            {
                flag            = true;
                inode           = doc.CreateElement("c");
                inode.InnerText = ((Label)item.FindControl("lblCode")).Text.ToString().Trim();
                element.AppendChild(inode);

                inode           = doc.CreateElement("l");
                inode.InnerText = ((TextBox)item.FindControl("lbllimit")).Text.ToString();
                element.AppendChild(inode);

                inode           = doc.CreateElement("n");
                inode.InnerText = ((Label)item.FindControl("lblname")).Text.ToString().Trim();
                element.AppendChild(inode);

                finode.AppendChild(element);
            }
        }
        if (flag == true)
        {
            Other_Z.OtherBAL objbl = new Other_Z.OtherBAL();
            objbl.SaveSalesmnBookSetLimit(finode.OuterXml.ToString(), txtMRCode.Text.Split(':')[0].ToString(), Convert.ToInt32(strFY), UserName, "booksetsave", "");
            MessageBox("Record Save Successfull");
            txtMRCode.Text = "";
            txtMRCode.Focus();
            grdBookset.Visible  = false;
            btndownsave.Visible = false;
        }
        else
        {
            MessageBox("Kindly, enter the limit");
            return;
        }
    }
    protected void BindStatus()
    {
        Other_Z.OtherBAL ObjDal = new Other_Z.OtherBAL();
        string           Flag   = "Status";
        DataSet          DSX    = ObjDal.BindStatus(Flag);
        DataTable        dt     = new DataTable();

        DSX.Tables.Add(dt);
        InqSatatus.DataSource    = DSX;
        InqSatatus.DataTextField = "Status_Name";
        InqSatatus.DataBind();
        InqSatatus.Items.Insert(0, new ListItem("Select", "NA"));
        //Flag = "Escalation";
        //DSX = ObjDal.BindStatus(Flag);
        //DDlEscalation.DataSource = DSX;
        //DDlEscalation.DataBind();
        //DDlEscalation.Items.Insert(0, new ListItem("Select", "Na"));
    }
예제 #9
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        docdate = txtdocDate.Text.Split('/')[2] + "/" + txtdocDate.Text.Split('/')[1] + "/" + txtdocDate.Text.Split('/')[0];
        ddt     = Convert.ToDateTime(docdate);
        string BankCode = txtbankcode.Text.Trim();

        //BankPayment obBnkpay = new BankPayment();
        Other_Z.OtherBAL.SaveBankPay obBnkpay = new Other_Z.OtherBAL.SaveBankPay();
        Other_Z.OtherBAL             ObjBal   = new Other_Z.OtherBAL();

        // txtdocno.Text = BankPayment.Get_BankPaymentDocNo(BankCode);

        // txtdocDate.Text = DateTime.Now.ToString("dd/MM/yyyy");

        if (Session["UserName"] != null)
        {
            try
            {
                obBnkpay.BankPaymentID = Convert.ToInt32(LblBankPID.Text);
                obBnkpay.BankCode      = txtbankcode.Text.Trim();
                // obBnkpay.DocumentNo = 0;
                obBnkpay.Serialno       = 1;
                obBnkpay.DocumentDate   = ddt;
                obBnkpay.AccountCode    = txtAccode.Text.Trim();;
                obBnkpay.PersonInCharge = txtperson.Text.Trim();
                obBnkpay.ReportCode     = txtreportcode.Text.Trim();
                obBnkpay.Cash_Cheque_DD = DDLCCDD.SelectedItem.Text;
                // obBnkpay.Type = txtType.Text.Trim();
                obBnkpay.Cheque_DD_NO   = txtCCDDNo.Text.Trim();
                obBnkpay.Amount         = Convert.ToDecimal(txtAmt.Text.Trim());
                obBnkpay.DrawnOn        = txtDrawnon.Text.Trim();
                obBnkpay.Remarks        = txtRemark.Text.Trim();
                obBnkpay.IsActive       = true;
                obBnkpay.IsChequeBounce = CheckActive.Checked;

                obBnkpay.CreatedBy = Session["UserName"].ToString();
                obBnkpay.strFY     = Convert.ToInt32(strFY);
                if (Session["url"] != null)
                {
                    obBnkpay.Paymode = "Addcomision";
                }
                else
                {
                    obBnkpay.Paymode = "";
                }
                //obBnkpay.Save(out DocNo);
                ObjBal.SaveBankPayment(obBnkpay, out DocNo);
                txtdocno.Text = Convert.ToString(DocNo);
                // MessageBox("Record saved successfully");
                MessageBox(Constants.save + "\\r\\n Document No: " + (txtdocno.Text));
                loder("Last saved Document no. : " + txtdocno.Text);
                GrdBankPDetails.DataBind();

                txtbankcode.Text = "";
                lblbankname.Text = "";
                txtdocno.Text    = "";
                txtdocDate.Text  = DateTime.Now.ToString("dd/MM/yyyy");
                // txtsrno.Text = "";
                txtAccode.Text        = "";
                lblaccname.Text       = "";
                txtperson.Text        = "";
                txtreportcode.Text    = "";
                lblacname.Text        = "";
                DDLCCDD.SelectedIndex = 0;
                //txtType.Text = "";
                txtCCDDNo.Text          = "";
                txtAmt.Text             = "";
                txtDrawnon.Text         = "";
                lblDrawnonname.Text     = "";
                txtRemark.Text          = "";
                Session["url"]          = null;
                CheckActive.Checked     = false;
                lblCustOS.Text          = "";
                btn_Save.Text           = "Save";
                PnlAddBankP.Visible     = true;
                Pnldate.Visible         = false;
                PnlBankPDetails.Visible = false;
            }
            catch
            {
            }
        }
    }
예제 #10
0
    public void BindAllDate()
    {
        #region FromDate ToDate CustomerCode And Status
        if (txtFrom.Text != string.Empty && txtTo.Text != string.Empty && txtCutomerName.Text != string.Empty && InqSatatus.SelectedItem.Text != "Select")
        {
            Other_Z.OtherBAL ObjDal = new Other_Z.OtherBAL();
            HelpDeskReports  IDS    = new HelpDeskReports();
            DataSet          DS     = new DataSet();

            string FromDate = DateTime.Now.ToString("MM/dd/yyyy");
            string TODate   = DateTime.Now.ToString("MM/dd/yyyy");
            FromDate = txtFrom.Text.Split('/')[1] + "/" + txtFrom.Text.Split('/')[0] + "/" + txtFrom.Text.Split('/')[2];
            TODate   = txtTo.Text.Split('/')[1] + "/" + txtTo.Text.Split('/')[0] + "/" + txtTo.Text.Split('/')[2];
            DS       = ObjDal.AllRecordRepordTicketHistory(Convert.ToDateTime(FromDate), Convert.ToDateTime(TODate), "0", "0", txtCutomerName.Text.Split(':')[0].ToString(), "0", "0", InqSatatus.SelectedValue, "FD&TD&Status&CustCode");
            if (DS.Tables[0].Rows.Count > 0)
            {
                crystalreportviewercheque.Visible = true;
                DataView       dv = new DataView(DS.Tables[0]);
                ReportDocument rd = new ReportDocument();
                rd.Load(Server.MapPath("Report/CallReport.rpt"));
                rd.Database.Tables[0].SetDataSource(dv);
                crystalreportviewercheque.ReportSource = rd;
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Record are not Found !')", true);
                crystalreportviewercheque.Visible = false;
                txtFrom.Focus();
            }
        }
        #endregion

        #region FromDate ToDate CustomerCode
        else if (txtFrom.Text != string.Empty && txtTo.Text != string.Empty && txtCutomerName.Text != string.Empty)
        {
            Other_Z.OtherBAL ObjDal = new Other_Z.OtherBAL();
            HelpDeskReports  IDS    = new HelpDeskReports();
            DataSet          DS     = new DataSet();

            string FromDate = DateTime.Now.ToString("MM/dd/yyyy");
            string TODate   = DateTime.Now.ToString("MM/dd/yyyy");
            FromDate = txtFrom.Text.Split('/')[1] + "/" + txtFrom.Text.Split('/')[0] + "/" + txtFrom.Text.Split('/')[2];
            TODate   = txtTo.Text.Split('/')[1] + "/" + txtTo.Text.Split('/')[0] + "/" + txtTo.Text.Split('/')[2];
            DS       = ObjDal.AllRecordRepordTicketHistory(Convert.ToDateTime(FromDate), Convert.ToDateTime(TODate), "0", "0", txtCutomerName.Text.Split(':')[0].ToString(), "0", "0", "0", "FD&TD&CustCode");
            if (DS.Tables[0].Rows.Count > 0)
            {
                crystalreportviewercheque.Visible = true;
                DataView       dv = new DataView(DS.Tables[0]);
                ReportDocument rd = new ReportDocument();
                rd.Load(Server.MapPath("Report/CallReport.rpt"));
                rd.Database.Tables[0].SetDataSource(dv);
                crystalreportviewercheque.ReportSource = rd;
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Record are not Found !')", true);
                crystalreportviewercheque.Visible = false;
                txtFrom.Focus();
            }
        }
        #endregion

        #region FromDate ToDate And Status
        else if (txtFrom.Text != string.Empty && txtTo.Text != string.Empty && InqSatatus.SelectedItem.Text != "Select")
        {
            Other_Z.OtherBAL ObjDal   = new Other_Z.OtherBAL();
            HelpDeskReports  IDS      = new HelpDeskReports();
            DataSet          DS       = new DataSet();
            string           FromDate = DateTime.Now.ToString("MM/dd/yyyy");
            string           TODate   = DateTime.Now.ToString("MM/dd/yyyy");
            FromDate = txtFrom.Text.Split('/')[1] + "/" + txtFrom.Text.Split('/')[0] + "/" + txtFrom.Text.Split('/')[2];
            TODate   = txtTo.Text.Split('/')[1] + "/" + txtTo.Text.Split('/')[0] + "/" + txtTo.Text.Split('/')[2];
            DS       = ObjDal.AllRecordRepordTicketHistory(Convert.ToDateTime(FromDate), Convert.ToDateTime(TODate), "0", "0", "0", "0", "0", InqSatatus.SelectedValue, "FD&TD&Status");
            if (DS.Tables[0].Rows.Count > 0)
            {
                crystalreportviewercheque.Visible = true;
                DataView       dv = new DataView(DS.Tables[0]);
                ReportDocument rd = new ReportDocument();
                rd.Load(Server.MapPath("Report/CallReport.rpt"));
                rd.Database.Tables[0].SetDataSource(dv);
                crystalreportviewercheque.ReportSource = rd;
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Record are not Found !')", true);
                crystalreportviewercheque.Visible = false;
                txtFrom.Focus();
            }
        }
        #endregion

        #region From Date To Date Method
        else if (txtFrom.Text != string.Empty && txtTo.Text != string.Empty)
        {
            Other_Z.OtherBAL ObjDal   = new Other_Z.OtherBAL();
            HelpDeskReports  IDS      = new HelpDeskReports();
            DataSet          DS       = new DataSet();
            string           FromDate = DateTime.Now.ToString("MM/dd/yyyy");
            string           TODate   = DateTime.Now.ToString("MM/dd/yyyy");
            FromDate      = txtFrom.Text.Split('/')[1] + "/" + txtFrom.Text.Split('/')[0] + "/" + txtFrom.Text.Split('/')[2];
            TODate        = txtTo.Text.Split('/')[1] + "/" + txtTo.Text.Split('/')[0] + "/" + txtTo.Text.Split('/')[2];
            InqBal.Action = "FD&TD";
            DS            = ObjDal.AllRecordRepordTicketHistory(Convert.ToDateTime(FromDate), Convert.ToDateTime(TODate), "0", "0", "0", "0", "0", "0", "FD&TD");
            if (DS.Tables[0].Rows.Count > 0)
            {
                crystalreportviewercheque.Visible = true;
                DataView       dv = new DataView(DS.Tables[0]);
                ReportDocument rd = new ReportDocument();
                rd.Load(Server.MapPath("Report/CallReport.rpt"));
                rd.Database.Tables[0].SetDataSource(dv);
                crystalreportviewercheque.ReportSource = rd;
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Record are not Found !')", true);
                crystalreportviewercheque.Visible = false;
                txtFrom.Focus();
            }
        }
        #endregion
    }
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            if (grdBookDetails.Rows.Count == 0)
            {
                MessageBox("Kindly fill Book details");
                txtsalemanCode.Focus();
                return;
            }
            if (txtTrasnport.Text == "")
            {
                MessageBox("Kindly Select Transpoter");
                txtTrasnport.Focus();
                return;
            }
            else
            {
                Other_Z.OtherBAL.SpecimanCN _objSepciman = new Other_Z.OtherBAL.SpecimanCN();
                Other_Z.OtherBAL            objbal       = new Other_Z.OtherBAL();
                string CNDate = txtCNDate.Text.Split('/')[1] + "/" + txtCNDate.Text.Split('/')[0] + "/" + txtCNDate.Text.Split('/')[2];
                _objSepciman.GCN           = Convert.ToInt32(txtGCN.Text == "" ? "0" : txtGCN.Text);
                _objSepciman.SCN           = Convert.ToInt32(txtSCN.Text == "" ? "0" : txtSCN.Text);
                _objSepciman.CNDate        = Convert.ToDateTime(CNDate);
                _objSepciman.LrNo          = Convert.ToInt32(txtlrno.Text == "" ? "0" : txtlrno.Text);
                _objSepciman.SalesmanId    = txtsalemanCode.Text.Split(':')[0];
                _objSepciman.FY            = Convert.ToInt32(strFY);
                _objSepciman.SpInstruction = txtspInstruct.Text.Trim();
                _objSepciman.CreatedBy     = Convert.ToString(Session["UserName"]);;
                _objSepciman.XmlData       = SaveSpecimanDetails();
                // SaveSpecimanDetails(1);
                _objSepciman.BooksetId    = Convert.ToInt32(DDLSelectSet.SelectedValue);
                _objSepciman.BooksetQty   = Convert.ToInt32(txtsetqty.Text);
                _objSepciman.TrasportCode = txtTrasnport.Text.Split(':')[0];

                objbal.SaveReturnSpeciman(_objSepciman);

                // _objSepciman.ChallanDate = Convert.ToDateTime(ChallanDate);
                // string ordno = txtorder.Text.Trim();
                //if (ordno == "")
                //{
                //    ordno = "0";
                //}
                //  _objSepciman.OrderNo = txtorder.Text.Trim();
                // _objSepciman.OrderDate = Convert.ToDateTime(OrderDate);


                //_objSepciman.IsActive = true;
                //_objSepciman.IsDeleted = false;

                //  _objSepciman.Description = Description;


                //_objSepciman.Save(out DocNo, 1, out DocNewNo);
                // _objSepciman.Save(out DocNo);
                //txtGCN.Text = Convert.ToString(DocNo);


                //  MessageBox("Record saved successfully \\r\\n Documennt no.  " );
                MessageBox("Record saved successfully ");


                //lblmsg.Text = "Last saved Document no. : " + txtGCN.Text;
                txtGCN.Text               = "";
                txtSCN.Text               = "";
                Session["tempBookData"]   = null;
                grdBookDetails.DataSource = null;
                grdBookDetails.DataBind();
                upGridData.Update();
                DDLSelectSet.SelectedValue = "0";
                Description = "";
            }
        }
        catch (Exception ex)
        {
            string ermsg = ex.Message.ToString();
        }
    }
    protected void btnAddAccess_Click(object sender, EventArgs e)
    {
        Other_Z.OtherBAL ObjBAL   = new Other_Z.OtherBAL();
        string           BookCode = txtBookType.Text.Split(':')[0].Trim();
        DataSet          ds       = ObjBAL.GetBookIdWithBookType(BookCode, Convert.ToInt32(Session["FY"]), "booktype");

        if (ds.Tables[0].Rows.Count > 0)
        {
            DataTable dt = GetDataTempTableAssorted();
            if (dt != null)
            {
                if (Convert.ToInt32(txtDiscount.Text) <= 0 || Convert.ToInt32(txtDiscount.Text) >= 100)
                {
                    MessageBox("Discount greater then 0 and less then 100");
                    txtDiscount.Focus();
                    return;
                }
                if (Convert.ToInt32(txtFromQty.Text) >= Convert.ToInt32(txtToQty.Text))
                {
                    MessageBox("From quantity shold be less than To quantity");
                    txtFromQty.Focus();
                    return;
                }
                else
                {
                    //
                    //DataRow[] rows1 = dt.Select("BookType = '" + BookCode + "' And ToQty > " + txtFromQty.Text);
                    //if (rows1.Length > 0)
                    //{
                    //    MessageBox("Wrong from quantity and to quantity");
                    //    txtFromQty.Focus();
                    //    return;
                    //}

                    bool      isflage = false;
                    DataRow[] rows    = dt.Select("BookType = '" + BookCode + "' And FromQty =" + txtFromQty.Text + " And ToQty = " + txtToQty.Text + "And Discount=" + txtDiscount.Text + "");

                    DataRow dr = null;
                    if (rows.Length > 0)
                    {
                        dr      = rows[0];
                        isflage = true;
                        MessageBox("Already Add Assorted Discount");
                        txtTODAmount.Focus();
                        return;
                    }
                    else
                    {
                        dt.DefaultView.Sort = "BookType ASC";
                        dr = dt.NewRow();
                    }
                    dr["BookType"] = BookCode;
                    dr["Bookid"]   = ds.Tables[0].Rows[0][0].ToString();
                    dr["FromQty"]  = Convert.ToInt32(txtFromQty.Text.Trim());
                    dr["ToQty"]    = Convert.ToInt32(txtToQty.Text.Trim());
                    dr["Discount"] = Convert.ToInt32(txtDiscount.Text.Trim());

                    if (!isflage)
                    {
                        AddRowAssorted(dr);
                        txtTODAmount.Text = "";
                        txtTodDis.Text    = "";
                    }
                }
                GridAssorted.DataSource = dt;
                GridAssorted.DataBind();
                GridAssorted.Visible = true;
                txtBookType.Text     = "";
                txtFromQty.Text      = "";
                txtToQty.Text        = "";
                txtDiscount.Text     = "";
                txtBookType.Focus();
            }
        }
        else
        {
            MessageBox("Invalid book name please try again");
            txtBookType.Text = "";
            txtBookType.Focus();
            return;
        }
    }
    public void BindAllDate()
    {
        #region FromDate And ToDate And Customer And Status And Executive
        if (txtFrom.Text != string.Empty && txtTo.Text != string.Empty && txtCutomerName.Text != string.Empty && InqSatatus.SelectedItem.Text
            != "Select" && txtExeutiveName.Text != string.Empty)
        {
            HelpDeskReports  IDS    = new HelpDeskReports();
            Other_Z.OtherBAL ObjDal = new Other_Z.OtherBAL();

            DataSet DS       = new DataSet();
            string  FromDate = DateTime.Now.ToString("MM/dd/yyyy");
            string  TODate   = DateTime.Now.ToString("MM/dd/yyyy");
            FromDate = txtFrom.Text.Split('/')[1] + "/" + txtFrom.Text.Split('/')[0] + "/" + txtFrom.Text.Split('/')[2];
            TODate   = txtTo.Text.Split('/')[1] + "/" + txtTo.Text.Split('/')[0] + "/" + txtTo.Text.Split('/')[2];
            DS       = ObjDal.AllRecordRepordTicketHistory(Convert.ToDateTime(FromDate), Convert.ToDateTime(TODate), "0", "0", txtCutomerName.Text.Split(':')[0].ToString(),
                                                           txtExeutiveName.Text, "0", InqSatatus.SelectedValue, "FD&TD&Status&CustCode&EmpCode");
            if (DS.Tables[0].Rows.Count > 0)
            {
                CustomerWiseAmount.Visible = true;
                DataView       dv = new DataView(DS.Tables[0]);
                ReportDocument rd = new ReportDocument();
                rd.Load(Server.MapPath("Report/CallReportExecutive.rpt"));
                rd.Database.Tables[0].SetDataSource(dv);
                CustomerWiseAmount.ReportSource = rd;
                CustomerWiseAmount.RefreshReport();
                CustomerWiseAmount.DataBind();
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Record not Found !')", true);
                CustomerWiseAmount.Visible = false;
                txtFrom.Focus();
            }
        }
        #endregion

        #region FromDate And ToDate And Customer And Status
        else if (txtFrom.Text != string.Empty && txtTo.Text != string.Empty && txtCutomerName.Text != string.Empty && InqSatatus.SelectedItem.Text != "Select")
        {
            Other_Z.OtherBAL ObjDal = new Other_Z.OtherBAL();
            HelpDeskReports  IDS    = new HelpDeskReports();
            DataSet          DS     = new DataSet();

            string FromDate = DateTime.Now.ToString("MM/dd/yyyy");
            string TODate   = DateTime.Now.ToString("MM/dd/yyyy");
            FromDate = txtFrom.Text.Split('/')[1] + "/" + txtFrom.Text.Split('/')[0] + "/" + txtFrom.Text.Split('/')[2];
            TODate   = txtTo.Text.Split('/')[1] + "/" + txtTo.Text.Split('/')[0] + "/" + txtTo.Text.Split('/')[2];

            DS = ObjDal.AllRecordRepordTicketHistory(Convert.ToDateTime(FromDate), Convert.ToDateTime(TODate), "0", "0", txtCutomerName.Text.Split(':')[0].ToString(),
                                                     "0", "0", InqSatatus.SelectedValue, "FD&TD&Status&CustCode");
            if (DS.Tables[0].Rows.Count > 0)
            {
                CustomerWiseAmount.Visible = true;
                DataView       dv = new DataView(DS.Tables[0]);
                ReportDocument rd = new ReportDocument();
                rd.Load(Server.MapPath("Report/CallReportExecutive.rpt"));
                rd.Database.Tables[0].SetDataSource(dv);
                CustomerWiseAmount.ReportSource = rd;
                CustomerWiseAmount.RefreshReport();
                CustomerWiseAmount.DataBind();
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Record are not Found !')", true);
                CustomerWiseAmount.Visible = false;
                txtFrom.Focus();
            }
        }
        #endregion

        #region FromDate And ToDate And Status
        else if (txtFrom.Text != string.Empty && txtTo.Text != string.Empty && InqSatatus.SelectedItem.Text != "Select")
        {
            //if (txtFrom.Text != string.Empty && txtTo.Text != string.Empty && InqSatatus.SelectedItem.Text != "Select")
            //{
            Other_Z.OtherBAL ObjDal   = new Other_Z.OtherBAL();
            HelpDeskReports  IDS      = new HelpDeskReports();
            DataSet          DS       = new DataSet();
            string           FromDate = DateTime.Now.ToString("MM/dd/yyyy");
            string           TODate   = DateTime.Now.ToString("MM/dd/yyyy");
            FromDate = txtFrom.Text.Split('/')[1] + "/" + txtFrom.Text.Split('/')[0] + "/" + txtFrom.Text.Split('/')[2];
            TODate   = txtTo.Text.Split('/')[1] + "/" + txtTo.Text.Split('/')[0] + "/" + txtTo.Text.Split('/')[2];
            //InqBal.Fromdate = Convert.ToDateTime(txtFrom.Text.Split('/')[2] + "/" + txtFrom.Text.Split('/')[1] + "/" + txtFrom.Text.Split('/')[0]);
            //InqBal.ToDate = Convert.ToDateTime(txtTo.Text.Split('/')[2] + "/" + txtTo.Text.Split('/')[1] + "/" + txtTo.Text.Split('/')[0]);
            //InqBal.Status = InqSatatus.SelectedValue;
            //InqBal.Action = "FD&TD&Status";
            DS = ObjDal.AllRecordRepordTicketHistory(Convert.ToDateTime(FromDate), Convert.ToDateTime(TODate), "0", "0", "0", "0", "0", InqSatatus.SelectedValue, "FD&TD&Status");
            if (DS.Tables[0].Rows.Count > 0)
            {
                CustomerWiseAmount.Visible = true;
                DataView       dv = new DataView(DS.Tables[0]);
                ReportDocument rd = new ReportDocument();
                rd.Load(Server.MapPath("Report/CallReportExecutive.rpt"));
                rd.Database.Tables[0].SetDataSource(dv);
                CustomerWiseAmount.ReportSource = rd;
                CustomerWiseAmount.RefreshReport();
                CustomerWiseAmount.DataBind();
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Record are not Found !')", true);
                CustomerWiseAmount.Visible = false;
                txtFrom.Focus();
            }

            //  }
            //else
            //{
            //    ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Please Enter Between Date.. !')", true);
            //    txtFrom.Focus();
            //    txtFrom.Text = "";

            //}
        }
        #endregion

        #region FromDate And ToDate And Customer
        else if (txtFrom.Text != string.Empty && txtTo.Text != string.Empty && txtCutomerName.Text != string.Empty)
        {
            Other_Z.OtherBAL ObjDal = new Other_Z.OtherBAL();
            HelpDeskReports  IDS    = new HelpDeskReports();
            DataSet          DS     = new DataSet();

            string FromDate = DateTime.Now.ToString("MM/dd/yyyy");
            string TODate   = DateTime.Now.ToString("MM/dd/yyyy");
            FromDate = txtFrom.Text.Split('/')[1] + "/" + txtFrom.Text.Split('/')[0] + "/" + txtFrom.Text.Split('/')[2];
            TODate   = txtTo.Text.Split('/')[1] + "/" + txtTo.Text.Split('/')[0] + "/" + txtTo.Text.Split('/')[2];

            DS = ObjDal.AllRecordRepordTicketHistory(Convert.ToDateTime(FromDate), Convert.ToDateTime(TODate), "0", "0", txtCutomerName.Text.Split(':')[0].ToString(),
                                                     "0", "0", "0", "FD&TD&CustCode");
            if (DS.Tables[0].Rows.Count > 0)
            {
                CustomerWiseAmount.Visible = true;
                DataView       dv = new DataView(DS.Tables[0]);
                ReportDocument rd = new ReportDocument();
                rd.Load(Server.MapPath("Report/CallReportExecutive.rpt"));
                rd.Database.Tables[0].SetDataSource(dv);
                CustomerWiseAmount.ReportSource = rd;
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Record are not Found !')", true);
                CustomerWiseAmount.Visible = false;
                txtFrom.Focus();
            }
        }
        #endregion

        #region FromDate And ToDate And Exeutive
        else if (txtFrom.Text != string.Empty && txtTo.Text != string.Empty && txtExeutiveName.Text != string.Empty)
        {
            Other_Z.OtherBAL ObjDal = new Other_Z.OtherBAL();
            HelpDeskReports  IDS    = new HelpDeskReports();
            DataSet          DS     = new DataSet();

            string FromDate = DateTime.Now.ToString("MM/dd/yyyy");
            string TODate   = DateTime.Now.ToString("MM/dd/yyyy");
            FromDate = txtFrom.Text.Split('/')[1] + "/" + txtFrom.Text.Split('/')[0] + "/" + txtFrom.Text.Split('/')[2];
            TODate   = txtTo.Text.Split('/')[1] + "/" + txtTo.Text.Split('/')[0] + "/" + txtTo.Text.Split('/')[2];

            DS = ObjDal.AllRecordRepordTicketHistory(Convert.ToDateTime(FromDate), Convert.ToDateTime(TODate), "0", "0", "0",
                                                     txtExeutiveName.Text, "0", "0", "FD&TD&Emp");
            if (DS.Tables[0].Rows.Count > 0)
            {
                CustomerWiseAmount.Visible = true;
                DataView       dv = new DataView(DS.Tables[0]);
                ReportDocument rd = new ReportDocument();
                rd.Load(Server.MapPath("Report/CallReportExecutive.rpt"));
                rd.Database.Tables[0].SetDataSource(dv);
                CustomerWiseAmount.ReportSource = rd;
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Record are not Found !')", true);
                CustomerWiseAmount.Visible = false;
                txtFrom.Focus();
            }
        }
        #endregion
        #region FromDate And ToDate And Exeutive And Customer
        else if (txtFrom.Text != string.Empty && txtTo.Text != string.Empty && txtCutomerName.Text != string.Empty && txtExeutiveName.Text != string.Empty)
        {
            Other_Z.OtherBAL ObjDal = new Other_Z.OtherBAL();
            HelpDeskReports  IDS    = new HelpDeskReports();
            DataSet          DS     = new DataSet();

            string FromDate = DateTime.Now.ToString("MM/dd/yyyy");
            string TODate   = DateTime.Now.ToString("MM/dd/yyyy");
            FromDate = txtFrom.Text.Split('/')[1] + "/" + txtFrom.Text.Split('/')[0] + "/" + txtFrom.Text.Split('/')[2];
            TODate   = txtTo.Text.Split('/')[1] + "/" + txtTo.Text.Split('/')[0] + "/" + txtTo.Text.Split('/')[2];

            DS = ObjDal.AllRecordRepordTicketHistory(Convert.ToDateTime(FromDate), Convert.ToDateTime(TODate), "0", "0", txtCutomerName.Text.Split(':')[0].ToString(),
                                                     txtExeutiveName.Text, "0", "0", "FD&TD&Emp");
            if (DS.Tables[0].Rows.Count > 0)
            {
                CustomerWiseAmount.Visible = true;
                DataView       dv = new DataView(DS.Tables[0]);
                ReportDocument rd = new ReportDocument();
                rd.Load(Server.MapPath("Report/CallReportExecutive.rpt"));
                rd.Database.Tables[0].SetDataSource(dv);
                CustomerWiseAmount.ReportSource = rd;
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Record are not Found !')", true);
                CustomerWiseAmount.Visible = false;
                txtFrom.Focus();
            }
        }
        #endregion

        #region From Date And To Date
        else if (txtFrom.Text != string.Empty && txtTo.Text != string.Empty)
        {
            Other_Z.OtherBAL ObjDal   = new Other_Z.OtherBAL();
            HelpDeskReports  IDS      = new HelpDeskReports();
            DataSet          DS       = new DataSet();
            string           FromDate = DateTime.Now.ToString("MM/dd/yyyy");
            string           TODate   = DateTime.Now.ToString("MM/dd/yyyy");
            FromDate = txtFrom.Text.Split('/')[1] + "/" + txtFrom.Text.Split('/')[0] + "/" + txtFrom.Text.Split('/')[2];
            TODate   = txtTo.Text.Split('/')[1] + "/" + txtTo.Text.Split('/')[0] + "/" + txtTo.Text.Split('/')[2];

            DS = ObjDal.AllRecordRepordTicketHistory(Convert.ToDateTime(FromDate), Convert.ToDateTime(TODate), "0", "0", "0",
                                                     "0", "0", "0", "FD&TD");
            if (DS.Tables[0].Rows.Count > 0)
            {
                CustomerWiseAmount.Visible = true;
                DataView       dv = new DataView(DS.Tables[0]);
                ReportDocument rd = new ReportDocument();
                rd.Load(Server.MapPath("Report/CallReportExecutive.rpt"));
                rd.Database.Tables[0].SetDataSource(dv);
                CustomerWiseAmount.ReportSource = rd;
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Record are not Found !')", true);
                CustomerWiseAmount.Visible = false;
                txtFrom.Focus();
            }
        }
        #endregion
        else
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Record are not Found !')", true);
            CustomerWiseAmount.Visible = false;
            txtFrom.Focus();
        }
    }
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            if (grdBookDetails.Rows.Count == 0)
            {
                MessageBox("Kindly fill Book details");
            }
            else
            {
                Specimen _objSepciman = new Specimen();
                // _objSepciman.DocumentNo = Convert.ToInt32(txtdoc.Text.Trim());

                string DocumentDate = txtdocDate.Text.Split('/')[1] + "/" + txtdocDate.Text.Split('/')[0] + "/" + txtdocDate.Text.Split('/')[2];
                string ChallanDate  = txtChalDate.Text.Split('/')[1] + "/" + txtChalDate.Text.Split('/')[0] + "/" + txtChalDate.Text.Split('/')[2];
                string OrderDate    = txtOrdDate.Text.Split('/')[1] + "/" + txtOrdDate.Text.Split('/')[0] + "/" + txtOrdDate.Text.Split('/')[2];
                if (txtdoc.Text != "")
                {
                    _objSepciman.DocumentNo = Convert.ToInt32(txtdoc.Text.Trim());
                }
                _objSepciman.DocumentDate = Convert.ToDateTime(DocumentDate);
                _objSepciman.ChallanNo    = txtchalan.Text.Trim();
                _objSepciman.ChallanDate  = Convert.ToDateTime(ChallanDate);
                // string ordno = txtorder.Text.Trim();
                //if (ordno == "")
                //{
                //    ordno = "0";
                //}
                _objSepciman.OrderNo       = txtorder.Text.Trim();
                _objSepciman.OrderDate     = Convert.ToDateTime(OrderDate);
                _objSepciman.SalesmanCode  = txtsalemanCode.Text.Trim();
                _objSepciman.SpInstruction = txtspInstruct.Text.Trim();
                _objSepciman.IsActive      = true;
                _objSepciman.IsDeleted     = false;
                _objSepciman.CreatedBy     = Convert.ToString(Session["UserName"]);;
                _objSepciman.Description   = Description;

                _objSepciman.FinancialYearFrom = Convert.ToInt32(strFY);
                _objSepciman.Save(out DocNo, 1, out DocNewNo);
                // _objSepciman.Save(out DocNo);
                txtdoc.Text = Convert.ToString(DocNo);
                SaveSpecimanDetails(DocNo);
                Other_Z.OtherBAL objBal = new Other_Z.OtherBAL();
                if (DDLSelectSet.SelectedValue != "0")
                {
                    objBal.SaveSalesmnBookSetLimit(xmlstr, txtsalemanCode.Text, Convert.ToInt32(strFY), Convert.ToString(Session["UserName"]), "Updatebookset", "");
                }

                MessageBox("Record saved successfully \\r\\n Documennt no.  " + txtdoc.Text);



                lblmsg.Text          = "Last saved Document no. : " + txtdoc.Text;
                txtdoc.Text          = "";
                txtchalan.Text       = "";
                txtorder.Text        = "";
                txtsalemanCode.Text  = "";
                lblSalesManName.Text = "";
                txtorder.Focus();
                Session["tempBookData"]   = null;
                grdBookDetails.DataSource = null;
                grdBookDetails.DataBind();
                upGridData.Update();
                DDLSelectSet.SelectedValue = "0";
                Description = "";
            }
        }
        catch (Exception ex)
        {
            string ermsg = ex.Message.ToString();
        }
    }
    private void Save(string Flag)
    {
        try
        {
            if (grdBookDetails.Rows.Count == 0)
            {
                MessageBox("Kindly fill Book details");
            }
            if (txtTrasnport.Text == "")
            {
                MessageBox("Kindly Select Transpoter");
                txtTrasnport.Focus();
                return;
            }
            else
            {
                Other_Z.OtherBAL.SpecimanCN _objSepciman = new Other_Z.OtherBAL.SpecimanCN();
                Other_Z.OtherBAL            objbal       = new Other_Z.OtherBAL();
                string CNDate = txtCNDate.Text.Split('/')[1] + "/" + txtCNDate.Text.Split('/')[0] + "/" + txtCNDate.Text.Split('/')[2];
                _objSepciman.GCN           = Convert.ToInt32(txtGCN.Text == "" ? "0" : txtGCN.Text);
                _objSepciman.SCN           = Convert.ToInt32(txtSCN.Text == "" ? "0" : txtSCN.Text);
                _objSepciman.CNDate        = Convert.ToDateTime(CNDate);
                _objSepciman.LrNo          = Convert.ToInt32(txtlrno.Text == "" ? "0" : txtlrno.Text);
                _objSepciman.SalesmanId    = txtsalemanCode.Text.Split(':')[0];
                _objSepciman.FY            = Convert.ToInt32(strFY);
                _objSepciman.SpInstruction = txtspInstruct.Text.Trim();
                _objSepciman.CreatedBy     = Convert.ToString(Session["UserName"]);;
                _objSepciman.XmlData       = SaveSpecimanDetails();
                // SaveSpecimanDetails(1);
                _objSepciman.BooksetId = Convert.ToInt32(DDLSelectSet.SelectedValue);
                if (txtsetqty.Text.Trim() != "")
                {
                    _objSepciman.BooksetQty = Convert.ToInt32(txtsetqty.Text);
                }
                else
                {
                    _objSepciman.BooksetQty = 0;
                }
                _objSepciman.TrasportCode = txtTrasnport.Text.Split(':')[0];
                int insertno = 0;
                objbal.SaveReturnSpeciman(_objSepciman, out insertno);
                MessageBox("Record saved successfully Document No : " + insertno.ToString());

                if (Flag == "print")
                {
                    Page.ClientScript.RegisterStartupScript(
                        this.GetType(), "OpenWindow", "window.open('CNSpecimanPrint.aspx?docno=" + insertno.ToString() + "');", true);
                }
                ClearForm();

                // _objSepciman.ChallanDate = Convert.ToDateTime(ChallanDate);
                // string ordno = txtorder.Text.Trim();
                //if (ordno == "")
                //{
                //    ordno = "0";
                //}
                //  _objSepciman.OrderNo = txtorder.Text.Trim();
                // _objSepciman.OrderDate = Convert.ToDateTime(OrderDate);


                //_objSepciman.IsActive = true;
                //_objSepciman.IsDeleted = false;

                //  _objSepciman.Description = Description;


                //_objSepciman.Save(out DocNo, 1, out DocNewNo);
                // _objSepciman.Save(out DocNo);
                //txtGCN.Text = Convert.ToString(DocNo);


                //  MessageBox("Record saved successfully \\r\\n Documennt no.  " );



                //lblmsg.Text = "Last saved Document no. : " + txtGCN.Text;
            }
        }
        catch (Exception ex)
        {
            string ermsg = ex.Message.ToString();
        }
    }
    private void SaveEmailLog()
    {
        XmlDocument doc     = new XmlDocument();
        XmlNode     inode   = doc.CreateElement("f");
        XmlNode     fnode   = doc.CreateElement("r");
        XmlNode     element = doc.CreateElement("i");

        inode           = doc.CreateElement("subdoc");
        inode.InnerText = Invno;
        element.AppendChild(inode);

        inode           = doc.CreateElement("dcdoc");
        inode.InnerText = txtOrgDocNo.Text.ToString();
        element.AppendChild(inode);

        inode           = doc.CreateElement("mud");
        inode.InnerText = "invoice".ToString();
        element.AppendChild(inode);

        inode           = doc.CreateElement("toe");
        inode.InnerText = lblEmail.Text.ToString();
        element.AppendChild(inode);

        if (ConfigurationManager.AppSettings["invoice_cc"].ToString() != "-1")
        {
            inode           = doc.CreateElement("cc");
            inode.InnerText = ConfigurationManager.AppSettings["invoice_cc"].ToString();
            element.AppendChild(inode);
        }

        if (ConfigurationManager.AppSettings["invoice_bcc"].ToString() != "-1")
        {
            inode           = doc.CreateElement("bcc");
            inode.InnerText = ConfigurationManager.AppSettings["invoice_bcc"].ToString();
            element.AppendChild(inode);
        }

        inode           = doc.CreateElement("sub");
        inode.InnerText = ConfigurationManager.AppSettings["invoice_sub"].ToString() + Invno;
        element.AppendChild(inode);

        inode           = doc.CreateElement("msg");
        inode.InnerText = MailBodyDesign().ToString();
        element.AppendChild(inode);

        inode           = doc.CreateElement("sndtm");
        inode.InnerText = null;
        element.AppendChild(inode);

        inode           = doc.CreateElement("st");
        inode.InnerText = "pending".ToString();
        element.AppendChild(inode);

        inode           = doc.CreateElement("fp");
        inode.InnerText = "null".ToString();
        element.AppendChild(inode);

        inode           = doc.CreateElement("fy");
        inode.InnerText = Convert.ToInt32(Session["FY"]).ToString();
        element.AppendChild(inode);

        inode           = doc.CreateElement("ext");
        inode.InnerText = "Username :"******"Username"].ToString().ToString() + "," + "FromMail :" + ConfigurationManager.AppSettings["FromMail"].ToString() + "," + "Password :"******"Password"].ToString();
        element.AppendChild(inode);

        inode           = doc.CreateElement("rem1");
        inode.InnerText = "Insert".ToString();
        element.AppendChild(inode);

        inode           = doc.CreateElement("rem2");
        inode.InnerText = "".ToString();
        element.AppendChild(inode);

        inode           = doc.CreateElement("rem3");
        inode.InnerText = "".ToString();
        element.AppendChild(inode);

        fnode.AppendChild(element);

        Other_Z.OtherBAL ObjBal = new Other_Z.OtherBAL();
        ObjBal.SaveEmailLog(fnode.OuterXml, "invoice", "", "");
    }