protected void Page_Load(object sender, EventArgs e) { if (Session["ChetanaCompanyName"] != null) { if (Session["FY"] != null) { strChetanaCompanyName = Session["ChetanaCompanyName"].ToString(); strFY = Session["FY"].ToString(); if (!IsPostBack) { Rptrpending.DataSource = FillGridView("TokenPending", ""); Rptrpending.DataBind(); } } } if (txtIsExport.Value == "yes") { DataTable dt = (DataTable)Session["TokenPendingReport"]; bindreport(dt); txtIsExport.Value = ""; } if (Page.IsPostBack) { if (Session["TokenPendingReport"] != null) { DataTable dt = (DataTable)Session["TokenPendingReport"]; bindreport(dt); } } else { Session["TokenPendingReport"] = null; } }
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) { ViewState["cname"] = null; SMSSend.Text = "NO"; if (ConfigurationManager.AppSettings["SMS_INV_SEND"] != null) { SMSSend.Text = ConfigurationManager.AppSettings["SMS_INV_SEND"].ToString(); } Session["saved"] = null; docno.InnerHtml = "Not Selected"; //Rptrpending.DataSource = DCMaster.Get_ApprovedDocNo(Convert.ToInt32(strFY)); Rptrpending.DataSource = DCMaster.Get_ApprovedDocNo(Convert.ToInt32(strFY)); Rptrpending.DataBind(); } }
protected void RdlView_SelectedIndexChanged(object sender, EventArgs e) { RdBValue = RdlView.SelectedValue.ToString(); if (RdBValue == "Employee") { BindEmployee(); Pnlcust.Visible = true; pnlDate.Visible = false; pnlDetails.Visible = false; Rptrpending.Visible = true; Rptrpending.DataBind(); pnlconfirm.Visible = true; btnBookWice.Visible = false; DDLEmployee.Focus(); } //else if (RdBValue == "All") //{ // Pnlcust.Visible = false; // pnlDate.Visible = false; // Rptrpending.Visible = true; // Rptrpending.DataSource = Specimen.Get_PendingDocNo("All", System.DateTime.Now, System.DateTime.Now, Convert.ToInt32(strFY), ""); // Rptrpending.DataBind(); // upOrderNO.Update(); // pnlconfirm.Visible = true; // pnlDetails.Visible = false; // btnBookWice.Visible = true; //} else { datewise(); Rptrpending.DataBind(); } }
protected void RdlView_SelectedIndexChanged(object sender, EventArgs e) { pnlDetails.Visible = false; string RdBValue = RdlView.SelectedValue.ToString(); if (RdBValue == "Employee") { Pnlcust.Visible = true; pnlDate.Visible = false; Rptrpending.Visible = true; Rptrpending.DataBind(); DDLEmployee.Focus(); BindEmployee(); } else if (RdBValue == "All") { Pnlcust.Visible = false; pnlDate.Visible = false; Rptrpending.Visible = true; Rptrpending.DataBind(); bindData(); } else { pnlDate.Visible = true; Pnlcust.Visible = false; Rptrpending.DataBind(); } }
public void BindPanel() { RdBValue = RdlView.SelectedValue.ToString(); if (RdBValue == "Customer") { BindCustomer(); Pnlcust.Visible = true; // pnlDetails.Visible = false; Rptrpending.Visible = true; // Panel1.Visible = false; upDocNo.Update(); RepDetailsConfirm.DataBind(); Rptrpending.DataBind(); } if (RdBValue == "All") { Pnlcust.Visible = false; // pnlDetails.Visible = false; // Panel1.Visible = true; Rptrpending.Visible = true; Rptrpending.DataSource = DCDetails.Get_DC_Completed_IsApproved(Convert.ToInt32(strFY)); Rptrpending.DataBind(); upDocNo.Update(); RepDetailsConfirm.DataBind(); } }
protected void btnDate_Click(object sender, EventArgs e) { string from = txtFromDate.Text.Split('/')[2] + "/" + txtFromDate.Text.Split('/')[1] + "/" + txtFromDate.Text.Split('/')[0]; string To = txttoDate.Text.Split('/')[2] + "/" + txttoDate.Text.Split('/')[1] + "/" + txttoDate.Text.Split('/')[0]; fdate = Convert.ToDateTime(from); tdate = Convert.ToDateTime(To); if (fdate > tdate) { MessageBox("From Date is Greater than ToDate"); txtFromDate.Focus(); } else { Rptrpending.DataSource = DCMaster.Get_DC_Completed_IsApproved_ONOption(0, "invoicedate", Convert.ToInt32(strFY), Convert.ToDateTime(from), Convert.ToDateTime(To)); Rptrpending.DataBind(); pnlradio.Visible = true; Panelrepeater.Visible = true; Rptrpending.Visible = true; updateapprove.Update(); pnlDetails.Visible = false; } }
protected void btnemployee_Click(object sender, EventArgs e) { Rptrpending.DataSource = Specimen.Get_PendingDocNo("salesman", System.DateTime.Now, System.DateTime.Now, Convert.ToInt32(strFY), DDLEmployee.SelectedValue.ToString()); Rptrpending.DataBind(); pnlconfirm.Visible = true; pnlDetails.Visible = false; upOrderNO.Update(); }
public void BindPanel() { RdBValue = RdlView.SelectedValue.ToString(); if (RdBValue == "Customer") { BindCustomer(); Pnldeldate.Visible = false; pnlcity.Visible = false; Pnlcust.Visible = true; pnlDetails.Visible = false; Rptrpending.Visible = true; upOrderNO.Update(); pnlconfirm.Visible = false; // DDLCustomer.Items.Insert(0, new ListItem("- Select Customer-", "0")); } if (RdBValue == "DeliveryDate") { Pnldeldate.Visible = true; pnlcity.Visible = false; Pnlcust.Visible = false; pnlDetails.Visible = false; Rptrpending.Visible = true; upOrderNO.Update(); pnlconfirm.Visible = false; txtFromDate.Text = DateTime.Today.AddDays(-1).ToString("dd/MM/yyyy"); txttoDate.Text = DateTime.Today.ToString("dd/MM/yyyy"); } if (RdBValue == "All") { Pnldeldate.Visible = false; pnlcity.Visible = false; Pnlcust.Visible = false; Rptrpending.Visible = true; //Rptrpending.DataSource = DCMaster.Get_Pending_DocNo(); Rptrpending.DataSource = DCMaster.Get_Pending_DocNo(Convert.ToInt32(strFY)); Rptrpending.DataBind(); upOrderNO.Update(); // Bind_DDL_SuperZone(); pnlconfirm.Visible = true; pnlDetails.Visible = false; } if (RdBValue == "City") { Pnldeldate.Visible = false; pnlcity.Visible = true; Pnlcust.Visible = false; pnlconfirm.Visible = false; pnlDetails.Visible = false; Rptrpending.Visible = true; upOrderNO.Update(); DDlstate.DataSource = Destination.GetDestination(Convert.ToString("state")); DDlstate.DataBind(); DDlstate.Items.Insert(0, new ListItem("--Select State--", "0")); DDlCity.Items.Clear(); DDlCity.Items.Insert(0, new ListItem("--Select City--", "0")); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Cleardata(); Rptrpending.DataSource = Specimen.Get_ApprovedDocNo(); Rptrpending.DataBind(); } }
private void ChekedData() { Session["TokenPendingReport"] = null; Other_Z.OtherBAL ObjBAL = new OtherBAL(); OtherBAL.Token_Register_Property ObjProperty = new OtherBAL.Token_Register_Property(); int tokenid; Session["TokenPendingReport"] = null; ObjProperty.R1 = "UpdateTransaction"; ObjProperty.createdBy = Session["UserName"].ToString(); ObjProperty.FY = Convert.ToInt32(Session["FY"]); string TokenNo = ""; StringBuilder sb = new StringBuilder("<r>"); StringBuilder sb1 = new StringBuilder(); try { foreach (RepeaterItem i in Rptrpending.Items) { CheckBox chk = (CheckBox)i.FindControl("chkRepeater"); if (chk.Checked == true) { sb.Append("<i>"); TokenNo = Convert.ToInt32(((CheckBox)chk.Parent.FindControl("chkRepeater")).Text).ToString(); sb.Append("<x>" + TokenNo + "</x>"); sb.Append("</i>"); sb1.Append(TokenNo + ","); } } sb.Append("</r>"); if (TokenNo == "") { MessageBox("Please Checked The Record"); return; } ObjProperty.R2 = sb.ToString(); ObjBAL.Idv_Chetana_Save_Token_Register(ObjProperty, out tokenid); //DataTable dt = FillGridView("TokenTransferReport", sb1.ToString()); //Session["TokenPendingReport"] = dt; Rptrpending.DataSource = FillGridView("TokenPending", ""); Rptrpending.DataBind(); DataTable dt = DataPrint("print", sb1.ToString()); Session["TokenPendingReport"] = dt; bindreport(dt); //Page.ClientScript.RegisterStartupScript( //this.GetType(), "OpenWindow", "window.open('Token_Register_Report.aspx');", true); } catch { throw; } }
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) { ViewState["cname"] = null; SMSSend.Text = "NO"; if (ConfigurationManager.AppSettings["SMS_INV_SEND"] != null) { SMSSend.Text = ConfigurationManager.AppSettings["SMS_INV_SEND"].ToString(); } Session["saved"] = null; docno.InnerHtml = "Not Selected"; if (Request.QueryString["c"] != null) { //Rptrpending.DataSource = DCMaster.Get_ApprovedDocNo(Convert.ToInt32(strFY)); DataView dv = new DataView(DCMaster.Get_ApprovedDocNo(Convert.ToInt32(strFY)).Tables[0]); dv.RowFilter = "CustomerId = " + Request.QueryString["c"].ToString(); Rptrpending.DataSource = dv.ToTable(); Rptrpending.DataBind(); if (Request.QueryString["d"] != null) { try { stDS = new DataSet(); docno.InnerHtml = Request.QueryString["d"].ToString().Trim(); stDS = DCDetails.Get_SubDocId_And_ItsRecords_By_DocNo(Convert.ToInt32(Request.QueryString["d"].ToString()), "confirmed", Convert.ToInt32(strFY)); ViewState["staticDS"] = stDS; RepDetailsConfirm.DataSource = stDS.Tables[0]; RepDetailsConfirm.DataBind(); lblmessage.InnerHtml = ""; } catch (Exception ex) { } } } } }
protected void btncustomer_Click(object sender, EventArgs e) { Rptrpending.DataSource = DCMaster.Get_DC_Completed_IsApproved_ONOption(Convert.ToInt32(DDLCustomer.SelectedValue), "Customer", Convert.ToInt32(strFY), Convert.ToDateTime("1/11/2001"), Convert.ToDateTime("1/12/2001")); Rptrpending.DataBind(); // pnlconfirm.Visible = true; Panelrepeater.Visible = true; pnlDetails.Visible = false; Rptrpending.Visible = true; updateapprove.Update(); }
protected void btnsearch_Click(object sender, EventArgs e) { // pnlconfirm.Visible = true; //Rptrpending.DataSource = DCMaster.GetPendingDocNo_ForView(Convert.ToInt32(DDLCustomer.SelectedValue), "Customer", Convert.ToDateTime("1/11/2001"), Convert.ToDateTime("1/12/2001")); Rptrpending.DataSource = DCMaster.GetPendingDocNo_ForView(Convert.ToInt32(DDLCustomer.SelectedValue), "Customer", Convert.ToDateTime("1/11/2001"), Convert.ToDateTime("1/12/2001"), Convert.ToInt32(strFY)); Rptrpending.DataBind(); pnlconfirm.Visible = true; Rptrpending.Visible = true; upOrderNO.Update(); pnlDetails.Visible = false; }
protected void DDLCustomer_SelectedIndexChanged(object sender, EventArgs e) { Rptrpending.DataSource = ActualInvoiceDetails.GetCustomer_OnView(Convert.ToInt32(DDLCustomer.SelectedValue), "EditInvoice", Convert.ToInt32(strFY)); Rptrpending.DataBind(); // Panel1.Visible = true; upDocNo.Update(); Panel1.Visible = true; Rptrpending.Visible = true; //pnldetails.Visible = false; // RepDetailsConfirm.DataSource = null; // RepDetailsConfirm.DataBind(); // updategenerate.Update(); }
private void fillData() { //Rptrpending.DataSource = DCMaster.GetPendingDocNo_ForView(Convert.ToInt32(DDLCustomer.SelectedValue), "Customer", Convert.ToDateTime("1/11/2001"), Convert.ToDateTime("1/12/2001")); Rptrpending.DataSource = DCMaster.GetPendingDocNo_ForView(Convert.ToInt32(DDLCustomer.SelectedValue), "Customer_all", Convert.ToDateTime("1/11/2001"), Convert.ToDateTime("1/12/2001"), Convert.ToInt32(strFY)); Rptrpending.DataBind(); pnlconfirm.Visible = true; Rptrpending.Visible = true; upOrderNO.Update(); pnlDetails.Visible = false; DDLCustomer.Focus(); }
protected void RdlView_SelectedIndexChanged(object sender, EventArgs e) { RdBValue = RdlView.SelectedValue.ToString(); if (RdBValue == "Customer") { BindCustomer(); Pnldate.Visible = false; // pnlcity.Visible = false; Pnlcust.Visible = true; pnlDetails.Visible = false; Panelrepeater.Visible = false; Rptrpending.Visible = true; // updateapprove.Update(); // pnlconfirm.Visible = false; // DDLCustomer.Items.Insert(0, new ListItem("- Select Customer-", "0")); } if (RdBValue == "invoiceDate") { Pnldate.Visible = true; // pnlcity.Visible = false; Pnlcust.Visible = false; pnlDetails.Visible = false; Rptrpending.Visible = true; Panelrepeater.Visible = false; //updateapprove.Update(); // pnlconfirm.Visible = false; } if (RdBValue == "All") { Pnldate.Visible = false; // pnlcity.Visible = false; Pnlcust.Visible = false; Rptrpending.Visible = true; Panelrepeater.Visible = true; Rptrpending.DataSource = DCDetails.Get_DC_Completed_IsApproved(Convert.ToInt32(strFY)); Rptrpending.DataBind(); Rptrpending.Items.Insert(0, new ListItem("All", "0")); //updateapprove.Update(); // Bind_DDL_SuperZone(); // pnlconfirm.Visible = true; pnlDetails.Visible = false; } }
protected void DDlstate_SelectedIndexChanged(object sender, EventArgs e) { if (DDlstate.SelectedValue != "0") { DDlCity.Items.Clear(); // DDlCity.DataSource = Destination.GetDestination(Convert.ToString(DDlstate.SelectedValue)); DDlCity.DataSource = DCMaster.Get_Customer_PendingDocNo("city@" + DDlstate.SelectedValue.ToString(), Convert.ToInt32(strFY)); DDlCity.DataBind(); DDlCity.Items.Insert(0, new ListItem("--Select City--", "0")); Rptrpending.DataSource = DCMaster.GetPendingDocNo_ForView(Convert.ToInt32(DDlstate.SelectedValue), "City", Convert.ToDateTime("1/11/2001"), Convert.ToDateTime("1/12/2001"), Convert.ToInt32(strFY)); Rptrpending.DataBind(); if (Rptrpending.Items.Count > 0) { pnlconfirm.Visible = true; Rptrpending.Visible = true; upOrderNO.Update(); pnlDetails.Visible = false; } else { pnlconfirm.Visible = false; Rptrpending.Visible = false; upOrderNO.Update(); pnlDetails.Visible = false; } if (DDlCity.Items.Count > 0) { DDlCity.Focus(); } else { DDlstate.Focus(); } } else { DDlCity.DataBind(); DDlCity.Focus(); } }
public void bindData() { string RdBValue = RdlView.SelectedValue.ToString(); if (RdBValue == "Employee") { Rptrpending.DataSource = SpecimanDetails.Get_DC_Completed_IsApproved("salesman", System.DateTime.Now, System.DateTime.Now, Convert.ToInt32(strFY), DDLEmployee.SelectedValue.ToString()); Rptrpending.DataBind(); } else if (RdBValue == "All") { Rptrpending.DataSource = SpecimanDetails.Get_DC_Completed_IsApproved("all", System.DateTime.Now, System.DateTime.Now, Convert.ToInt32(strFY), DDLEmployee.SelectedValue.ToString()); Rptrpending.DataBind(); } else { try { string from = txtFromDate.Text.Split('/')[2] + "/" + txtFromDate.Text.Split('/')[1] + "/" + txtFromDate.Text.Split('/')[0]; string To = txttoDate.Text.Split('/')[2] + "/" + txttoDate.Text.Split('/')[1] + "/" + txttoDate.Text.Split('/')[0]; fdate = Convert.ToDateTime(from); tdate = Convert.ToDateTime(To); if (fdate > tdate) { MessageBox("From Date is Greater than ToDate"); txtFromDate.Focus(); } else { Rptrpending.DataSource = SpecimanDetails.Get_DC_Completed_IsApproved("datewise", fdate, tdate, Convert.ToInt32(strFY), ""); Rptrpending.DataBind(); } } catch (Exception ex) { } } Rptrpending.Items.Insert(0, new ListItem("All", "0")); Panelrepeater.Visible = true; }
protected void btnfind_Click(object sender, EventArgs e) { string from = txtFromDate.Text.Split('/')[2] + "/" + txtFromDate.Text.Split('/')[1] + "/" + txtFromDate.Text.Split('/')[0]; string To = txttoDate.Text.Split('/')[2] + "/" + txttoDate.Text.Split('/')[1] + "/" + txttoDate.Text.Split('/')[0]; fdate = Convert.ToDateTime(from); tdate = Convert.ToDateTime(To); if (fdate > tdate) { MessageBox("From Date is Greater than ToDate"); txtFromDate.Focus(); } else { Rptrpending.DataSource = Specimen.Get_PendingDocNo("datewise", fdate, tdate, Convert.ToInt32(strFY), ""); Rptrpending.DataBind(); pnlconfirm.Visible = true; pnlDetails.Visible = false; } upOrderNO.Update(); }
protected void DDlCity_SelectedIndexChanged(object sender, EventArgs e) { Rptrpending.DataSource = DCMaster.GetPendingDocNo_ForView(Convert.ToInt32(DDlCity.SelectedValue), "City", Convert.ToDateTime("1/11/2001"), Convert.ToDateTime("1/12/2001"), Convert.ToInt32(strFY)); Rptrpending.DataBind(); if (Rptrpending.Items.Count > 0) { pnlconfirm.Visible = true; Rptrpending.Visible = true; upOrderNO.Update(); pnlDetails.Visible = false; } else { MessageBox("Record not available"); pnlconfirm.Visible = false; Rptrpending.Visible = false; upOrderNO.Update(); pnlDetails.Visible = false; } }
protected void btnfind_Click(object sender, EventArgs e) { string from = txtFromDate.Text.Split('/')[2] + "/" + txtFromDate.Text.Split('/')[1] + "/" + txtFromDate.Text.Split('/')[0]; string To = txttoDate.Text.Split('/')[2] + "/" + txttoDate.Text.Split('/')[1] + "/" + txttoDate.Text.Split('/')[0]; fdate = Convert.ToDateTime(from); tdate = Convert.ToDateTime(To); if (fdate > tdate) { MessageBox("From Date is Greater than ToDate"); txtFromDate.Focus(); } else { Rptrpending.DataSource = DCMaster.GetPendingDocNo_ForView(0, "deliverydate", Convert.ToDateTime(from), Convert.ToDateTime(To), Convert.ToInt32(strFY)); Rptrpending.DataBind(); pnlconfirm.Visible = true; Rptrpending.Visible = true; upOrderNO.Update(); pnlDetails.Visible = false; } }
protected void DDLCustomer_SelectedIndexChanged(object sender, EventArgs e) { if (Cflag == "Cancel") { Rptrpending.DataSource = DCMaster.GetPendingDocNo_ForView(Convert.ToInt32(DDLCustomer.SelectedValue), "Customer", Convert.ToDateTime("1/11/2001"), Convert.ToDateTime("1/12/2001"), Convert.ToInt32(strFY)); Rptrpending.DataBind(); } if (Cflag == "Canceled") { Rptrpending.DataSource = DCMaster.GetPendingDocNo_ForView(Convert.ToInt32(DDLCustomer.SelectedValue), "Canceled", Convert.ToDateTime("1/11/2001"), Convert.ToDateTime("1/12/2001"), Convert.ToInt32(strFY)); Rptrpending.DataBind(); // Rptrpending.DataSource = DCMaster.Get_Customer_PendingDocNo("Pending"); // Rptrpending.DataBind(); } pnlconfirm.Visible = true; Rptrpending.Visible = true; Orderdetails.Visible = false; upOrderNO.Update(); // Rptrpending.DataSource = DCMaster.Get_Customer_PendingDocNo("Pending"); // Rptrpending.DataBind(); // pnlDetails.Visible = false; }
protected void btnGetData_click(object sender, EventArgs e) { DataTable dt = ObjDal.C_GetPendingApprovedDocNo(Convert.ToInt32(strFY), DDLCnfInvoice.SelectedValue.ToString()).Tables[0]; if (dt.Rows.Count > 0) { pnlDetails.Visible = false; Panel1.Visible = true; Panel3.Visible = true; Rptrpending.DataSource = dt; Rptrpending.DataBind(); } else { MessageBox("There is no pending Invoice for this CnF"); pnlDetails.Visible = false; Panel1.Visible = false; Panel3.Visible = false; pnlDetails.Visible = false; DDLCnfInvoice.Focus(); return; } }
public void BindPanel() { DataTable dt = ObjDal.C_GetPendingDocNo(Convert.ToInt32(FY), DDLCnf.SelectedValue.ToString()).Tables[0]; if (dt.Rows.Count > 0) { //Rptrpending.Visible = true; pnlconfirm.Visible = true; upOrderNO.Visible = true; pnlDetails.Visible = false; Rptrpending.DataSource = dt; Rptrpending.DataBind(); } else { MessageBox("There is no pending DC for this CnF "); pnlconfirm.Visible = false; pnlDetails.Visible = false; DDLCnf.Focus(); return; } //pnlDetails.Visible = false; }
public void callreseter() { RdBValue = RdlView.SelectedValue.ToString(); if (RdBValue == "Employee") { Rptrpending.DataSource = Specimen.Get_PendingDocNo("salesman", System.DateTime.Now, System.DateTime.Now, Convert.ToInt32(strFY), DDLEmployee.SelectedValue.ToString()); Rptrpending.DataBind(); } else if (RdBValue == "All") { Rptrpending.DataSource = Specimen.Get_PendingDocNo("All", System.DateTime.Now, System.DateTime.Now, Convert.ToInt32(strFY), ""); Rptrpending.DataBind(); } else { string from = txtFromDate.Text.Split('/')[2] + "/" + txtFromDate.Text.Split('/')[1] + "/" + txtFromDate.Text.Split('/')[0]; string To = txttoDate.Text.Split('/')[2] + "/" + txttoDate.Text.Split('/')[1] + "/" + txttoDate.Text.Split('/')[0]; fdate = Convert.ToDateTime(from); tdate = Convert.ToDateTime(To); if (fdate > tdate) { MessageBox("From Date is Greater than ToDate"); txtFromDate.Focus(); } else { Rptrpending.DataSource = Specimen.Get_PendingDocNo("datewise", fdate, tdate, Convert.ToInt32(strFY), ""); Rptrpending.DataBind(); pnlconfirm.Visible = true; pnlDetails.Visible = false; } upOrderNO.Update(); } pnlDetails.Visible = false; }
protected void btnPrint_Click(object sender, EventArgs e) { loder1("wait..", "4000"); ((Button)(sender)).Enabled = false; DCConfirmQtyDetails _objDCConfirmQtyDetails = new DCConfirmQtyDetails(); DCMaster _objDCMaster = new DCMaster(); try { _objDCConfirmQtyDetails.IsPrintInvoice = true; _objDCConfirmQtyDetails.CreatedBy = "admin"; _objDCConfirmQtyDetails.SubDocId = Convert.ToDecimal(((Button)(sender)).CommandArgument.Trim()); _objDCConfirmQtyDetails.AvailableQty = Convert.ToInt32(strFY); _objDCConfirmQtyDetails.Save_DC_PrintInvoiceDetails(1); // Rptrpending.DataSource = DCMaster.Get_ApprovedDocNo(); // Rptrpending.DataBind(); Rptrpending.DataSource = DCDetails.Get_DC_Completed_IsApproved(Convert.ToInt32(strFY)); Rptrpending.DataBind(); Rptrpending.Items.Insert(0, new ListItem("All", "0")); ((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/ReportInvoicePrint.aspx?d=" + docnewno + "&sd=" + ((Button)(sender)).CommandArgument.Trim() + "')", true); } catch (Exception ex) { MessageBox(ex.Message.ToString()); ((Button)(sender)).Enabled = true; } //} }
protected void btnconfirm_Click(object sender, EventArgs e) { btnconfirm.Enabled = false; Auth = DCMaster.Get_DocumentNum_Authentication(Convert.ToInt32(txtdocno.Text), Convert.ToInt32(strFY)); SubDocNo = Convert.ToDecimal(DCConfirmQtyDetails.Get_DCDetails_SubDocNo_ByDocID(Convert.ToInt32(txtdocno.Text), Convert.ToInt32(strFY)).Rows[0][0].ToString()); if (Auth) { MessageBox("Document no is not available"); txtdocno.Focus(); } else { DCConfirmQtyDetails _objDCConfirmQtyDetails = new DCConfirmQtyDetails(); DCMaster _objDCMaster = new DCMaster(); int DocId = 0; try { foreach (GridViewRow Row in grdconfirm.Rows) { _objDCConfirmQtyDetails.DCDetailID = Convert.ToInt32(((Label)Row.FindControl("lblDCdatils")).Text.Trim()); string Qty = ((TextBox)Row.FindControl("lblavailable")).Text.Trim(); _objDCConfirmQtyDetails.AvailableQty = Convert.ToInt32(Qty); DocId = Convert.ToInt32(((Label)Row.FindControl("lbldocNo")).Text.Trim()); _objDCConfirmQtyDetails.SubDocNo = SubDocNo; _objDCConfirmQtyDetails.SaveDCConfirmQtyDetails(); DCtoGodown _objDCMastertoGodown = new DCtoGodown(); foreach (GridViewRow row in grdconfirm.Rows) { _objDCMastertoGodown.DCDetailID = Convert.ToInt32(((Label)row.FindControl("lblDCdatils")).Text.Trim()); _objDCMastertoGodown.DocumentNo = Convert.ToInt32(((Label)row.FindControl("lbldocNo")).Text.Trim()); _objDCMastertoGodown.EmpID = txtempc.Text.Trim(); _objDCMastertoGodown.CreatedBy = Convert.ToString(Session["UserName"]); _objDCMastertoGodown.SaveGodown(); } } _objDCMaster.DocNo = DocId; _objDCMaster.IsConfirm = true; _objDCMaster.IsApproved = false; _objDCMaster.IsCanceled = false; _objDCMaster.Remark = txtremark.Text.Trim(); _objDCMaster.FinancialYearFrom = Convert.ToInt32(strFY); _objDCMaster.update(1); grdconfirm.DataBind(); MessageBox("DC Confirm successfully for document no. " + txtdocno.Text); loder("DC Confirm successfully for document no. " + txtdocno.Text); lblmessage.InnerHtml = "Last confirm doc no. : " + docno.InnerHtml; //docno.InnerHtml = "Last confirm doc no. : " + docno.InnerHtml; Rptrpending.DataSource = DCMaster.Get_Pending_DocNo(Convert.ToInt32(strFY)); Rptrpending.DataBind(); txtempc.Text = ""; lblEmpName.Text = ""; txtempc.Visible = false; lblEmpName.Visible = false; lblemp.Visible = false; btnconfirm.Visible = false; btnPrint.Visible = false; txtremark.Visible = false; docno.InnerHtml = ""; lblempname1.InnerHtml = ""; lblcustname.InnerHtml = ""; txtremark.Text = ""; string jv = "document.getElementById('ctl00_ContentPlaceHolder1_uc_PendingDC1_btnconfirm').style.display='none';"; ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "a", jv, true); upOrderNO.Update(); } catch (Exception ex) { MessageBox(ex.Message.ToString()); } } }
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()); } } }
protected void DDLCustomer_SelectedIndexChanged(object sender, EventArgs e) { Rptrpending.DataSource = Specimen.Get_PendingDocNo("Canceled", System.DateTime.Now, System.DateTime.Now, Convert.ToInt32(strFY), DDLCustomer.SelectedValue.ToString()); Rptrpending.DataBind(); upOrderNO.Update(); }
protected void RepDetailsConfirm_ItemCommand(object source, RepeaterCommandEventArgs e) { if (Session["saved"] == null) { Session["saved"] = "s"; } if (Session["saved"].ToString() != e.CommandArgument.ToString().Trim()) { //if (e.CommandName == "AddToCart") { bool Auth = DCMaster.Get_DocumentNum_Authentication(Convert.ToInt32(txtDocno.Text), Convert.ToInt32(strFY)); if (Auth) { MessageBox("Document no is not available"); txtDocno.Focus(); } else { DCConfirmQtyDetails _objDCConfirmQtyDetails = new DCConfirmQtyDetails(); DCMaster _objDCMaster = new DCMaster(); DCConfirmQtyDetails _objDCFT = new DCConfirmQtyDetails(); ActualInvoiceDetails _objactualinvoice = new ActualInvoiceDetails(); try { #region ActulInvoice Repeater objrep = (Repeater)this.FindControl("RepDetailsConfirm"); GridView objgrid = (GridView)objrep.Items[e.Item.ItemIndex].FindControl("grdapproval"); foreach (GridViewRow row in objgrid.Rows) { _objactualinvoice.DocumentNo = Convert.ToInt32(txtDocno.Text); _objactualinvoice.SubDocId = Convert.ToDecimal(e.CommandArgument.ToString().Trim()); _objactualinvoice.BookCode = ((Label)row.FindControl("lblbookC")).Text; _objactualinvoice.BookName = ((Label)row.FindControl("lblbookN")).Text; _objactualinvoice.Standard = ((Label)row.FindControl("lblStandard")).Text; _objactualinvoice.Medium = ((Label)row.FindControl("lblMedium")).Text; _objactualinvoice.Rate = Convert.ToDecimal(((TextBox)row.FindControl("txtrate")).Text); _objactualinvoice.Quantity = Convert.ToInt32(((Label)row.FindControl("lblAqty")).Text); _objactualinvoice.Discount = Convert.ToDecimal(((TextBox)row.FindControl("txtdiscount")).Text); _objactualinvoice.Amount = Convert.ToInt32(((Label)row.FindControl("lblAqty")).Text) * (Convert.ToDecimal(((TextBox)row.FindControl("txtrate")).Text) - (Convert.ToDecimal(((TextBox)row.FindControl("txtrate")).Text) * Convert.ToDecimal(((TextBox)row.FindControl("txtdiscount")).Text) / 100)); _objactualinvoice.Freight = Convert.ToDecimal(((TextBox)e.Item.FindControl("txtfrieght")).Text); _objactualinvoice.Tax = Convert.ToDecimal(((TextBox)e.Item.FindControl("txttax")).Text); _objactualinvoice.Transporter = (((TextBox)e.Item.FindControl("lbltransporter")).Text); _objactualinvoice.LRNo = (((TextBox)e.Item.FindControl("txtlrno")).Text); _objactualinvoice.TotalAmount = Convert.ToDecimal(getTotalValues(objgrid).ToString()) + Convert.ToDecimal(((TextBox)e.Item.FindControl("txtfrieght")).Text) + Convert.ToDecimal(((TextBox)e.Item.FindControl("txttax")).Text); _objactualinvoice.Bundles = (((TextBox)e.Item.FindControl("txtbundles")).Text); _objactualinvoice.CreatedBy = Convert.ToString(Session["UserName"]); _objactualinvoice.FinancialYearFrom = strFY; TextBox txtIdate1 = ((TextBox)e.Item.FindControl("txtdateabc")); TextBox txtLrdate1 = ((TextBox)e.Item.FindControl("txtlrdate")); _objactualinvoice.IsActive = true; _objactualinvoice.IsDeleted = false; string date1; string lrdate; if (txtIdate1.Text == "") { date1 = "1/1/2001"; } else { date1 = txtIdate1.Text.Split('/')[2] + "/" + txtIdate1.Text.Split('/')[1] + "/" + txtIdate1.Text.Split('/')[0]; } if (txtLrdate1.Text == "") { lrdate = "1/1/2001"; } else { lrdate = txtLrdate1.Text.Split('/')[2] + "/" + txtLrdate1.Text.Split('/')[1] + "/" + txtLrdate1.Text.Split('/')[0]; } _objactualinvoice.InvoiceDate = Convert.ToDateTime(date1); _objactualinvoice.LRDate = Convert.ToDateTime(lrdate); _objactualinvoice.Remark1 = ""; _objactualinvoice.Remark2 = ""; _objactualinvoice.Remark3 = ""; _objactualinvoice.SaveActual_InvoiceDetails(1); // (TextBox)e.Item.FindControl("txtfrieght"); } #endregion #region InvoiceCreate decimal subconfirmdoc = Convert.ToDecimal(e.CommandArgument.ToString().Trim()); _objDCConfirmQtyDetails.IsCreateInvoice = true; _objDCConfirmQtyDetails.CreatedInvoiceBy = Convert.ToString(Session["UserName"]); _objDCConfirmQtyDetails.SubDocNo = subconfirmdoc; // For financial year _objDCConfirmQtyDetails.AvailableQty = Convert.ToInt32(strFY); _objDCMaster.DocNo = Convert.ToInt32(txtDocno.Text); // Save Freight and tax Details frieght = Convert.ToDecimal(((TextBox)e.Item.FindControl("txtfrieght")).Text); tax = Convert.ToDecimal(((TextBox)e.Item.FindControl("txttax")).Text); temp = Convert.ToDecimal(tamount.Text) + frieght + tax; totalamount = Convert.ToDecimal(tamount.Text); _objDCFT.DocumentNo = Convert.ToInt32(txtDocno.Text); _objDCFT.SubDocNo = subconfirmdoc; _objDCFT.Freight = Convert.ToDecimal(((TextBox)e.Item.FindControl("txtfrieght")).Text); _objDCFT.Tax = Convert.ToDecimal(((TextBox)e.Item.FindControl("txttax")).Text); decimal TotalAmt = Convert.ToDecimal(getTotalValues(objgrid).ToString()) + Convert.ToDecimal(((TextBox)e.Item.FindControl("txtfrieght")).Text) + Convert.ToDecimal(((TextBox)e.Item.FindControl("txttax")).Text); _objDCFT.TotalAmount = Convert.ToDecimal(getTotalValues(objgrid).ToString()) + Convert.ToDecimal(((TextBox)e.Item.FindControl("txtfrieght")).Text) + Convert.ToDecimal(((TextBox)e.Item.FindControl("txttax")).Text); _objDCFT.LRNo = (((TextBox)e.Item.FindControl("txtlrno")).Text); TextBox txtIdate = ((TextBox)e.Item.FindControl("txtdateabc")); string date; if (txtIdate.Text == "") { date = "1/1/2001"; } else { date = txtIdate.Text.Split('/')[2] + "/" + txtIdate.Text.Split('/')[1] + "/" + txtIdate.Text.Split('/')[0]; } _objDCFT.InvoiceDate = Convert.ToDateTime(date); _objDCFT.AvailableQty = Convert.ToInt32(strFY); _objDCFT.Save_FrightTax_Details(1); _objDCConfirmQtyDetails.SaveConfirmDetails(1); stDS = new DataSet(); docno.InnerHtml = txtDocno.Text.Trim(); // stDS = DCDetails.Get_SubDocId_And_ItsRecords_By_DocNo(Convert.ToInt32(txtDocno.Text), "confirmed", Convert.ToInt32(strFY)); //if (ViewState["staticDS"] != null) //{ // stDS = (DataSet)ViewState["staticDS"]; //} //else //{ stDS = DCDetails.Get_SubDocId_And_ItsRecords_By_DocNo(Convert.ToInt32(txtDocno.Text), "confirmed", Convert.ToInt32(strFY)); //} RepDetailsConfirm.DataSource = stDS.Tables[0]; RepDetailsConfirm.DataBind(); #endregion MessageBox("Invoice created successfully " + subconfirmdoc); lblmessage.InnerHtml = "Last confirm doc no. : " + subconfirmdoc; if (Rptrpending.Items.Count == 1) { Rptrpending.DataSource = DCMaster.Get_ApprovedDocNo(Convert.ToInt32(strFY)); Rptrpending.DataBind(); //updateapprove.Update(); } if (RepDetailsConfirm.Items.Count == 0) { Rptrpending.DataSource = DCMaster.Get_ApprovedDocNo(Convert.ToInt32(strFY)); Rptrpending.DataBind(); upDocNo.Update(); docno.InnerHtml = ""; lblcustname.InnerHtml = ""; lblempname1.InnerHtml = ""; //updateapprove.Update(); } if (SMSSend.Text.ToUpper() == "YES") { sendMsg(lblMobNo.Text.Trim(), subconfirmdoc.ToString(), string.Format("{0:0.00}", TotalAmt).ToString(), (((TextBox)e.Item.FindControl("lbltransporter")).Text), (((TextBox)e.Item.FindControl("txtlrno")).Text), (((TextBox)e.Item.FindControl("txtbundles")).Text), txtIdate.Text.Trim()); //sendZoalMsg(((Label)e.Item.FindControl("lblCustId1")).Text, lblcustname.InnerHtml.Trim(), lblMobNo.Text.Trim(), subconfirmdoc.ToString(), string.Format("{0:0.00}", TotalAmt).ToString(), // (((TextBox)e.Item.FindControl("lbltransporter")).Text), // (((TextBox)e.Item.FindControl("txtlrno")).Text), // (((TextBox)e.Item.FindControl("txtbundles")).Text), // txtIdate.Text.Trim()); } //lblempname1.InnerHtml = ""; //lblcustname.InnerHtml = ""; // docno.InnerHtml = "" ; } catch (SqlException ex) { Response.Write(ex.Message.ToString()); } catch (Exception ex1) { Response.Write(ex1.Message.ToString()); } } } } ViewState["staticDS"] = null; Session["saved"] = e.CommandArgument.ToString().Trim(); updategenerate.Update(); }