protected void btnemployeeOrdersubmit_click(object sender, EventArgs e) { if (dpEmployee.SelectedItem.Value != "0") { int result = 0; Invoice inovice = new Invoice(); InvoiceData invoiceData = new InvoiceData(); inovice.orderDate = (Convert.ToDateTime(txtEmployeeOrderDate.Text)).ToString("dd-MM-yyyy"); inovice.AgencyID = 0; inovice.ShecemeApplied = true; //salesEmployee DataSet ds = new DataSet(); BillData billData = new BillData(); ds = billData.getEmployeeByUserId(GlobalInfo.Userid); inovice.SaleEmployeeId = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["EmployeeID"].ToString()) ? 0 : Convert.ToInt32(ds.Tables[0].Rows[0]["EmployeeID"]); inovice.EmployeeID = Convert.ToInt32(dpEmployee.SelectedItem.Value); inovice.totalCoast = string.IsNullOrEmpty(hfemployeeTotalBill.Value) ? 0 : Comman.Comman.IsValidInteger(hfemployeeTotalBill.Value) ? Convert.ToDouble(hfemployeeTotalBill.Value) : 0; inovice.CreatedBy = GlobalInfo.Userid; inovice.CreatedDate = DateTime.Now.ToString("dd/MM/yyyy"); inovice.TokanId = hftokanno.Value; inovice.orderType = 2;// employeeORder inovice.CurrentBoothID = GlobalInfo.CurrentbothID; inovice.PaymentMode = "Employee"; DataSet chkds = new DataSet(); chkds = invoiceData.CheckBoothTemp(inovice, 1); if (!Comman.Comman.IsDataSetEmpty(chkds)) { result = invoiceData.BoothInserOrder(inovice); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Please Add Items')", true); } if (result > 0) { //ScriptManager.RegisterStartupScript(pnlBill2, pnlBill2.GetType(), "PrintPanel2", "PrintPanel2()", true)) updateStock(); btnPrintEmp.Visible = true; Button1.Visible = false; btnAddEmployeeOrderItem.Visible = false; btnEmployeeNewOrder.Visible = false; btnRemoveOrder.Visible = false; pnlBill2.Visible = false; pnlBills.Visible = true; divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; pnlError.Update(); upMain.Update(); pnlBill2.Enabled = false; } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblwarning.Text = "Please Contact to Site Admin"; pnlError.Update(); } } else { // ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Please Select Employee')", true); } }
public void btnAgentORderSubmit_click(object sender, EventArgs e) { int result = 0; Invoice inovice = new Invoice(); InvoiceData invoiceData = new InvoiceData(); inovice.orderDate = (Convert.ToDateTime(txtGentOrderDate.Text)).ToString("dd-MM-yyyy"); inovice.AgencyID = Convert.ToInt32(dpAgent.SelectedItem.Value); inovice.ShecemeApplied = true; //salesEmployee DataSet ds = new DataSet(); BillData billData = new BillData(); ds = billData.getEmployeeByUserId(GlobalInfo.Userid); inovice.SaleEmployeeId = string.IsNullOrEmpty(ds.Tables[0].Rows[0]["EmployeeID"].ToString()) ? 0 : Convert.ToInt32(ds.Tables[0].Rows[0]["EmployeeID"]); inovice.totalCoast = string.IsNullOrEmpty(hftotalAmout.Value) ? 0 : Comman.Comman.IsValidInteger(hftotalAmout.Value) ? Convert.ToDouble(hftotalAmout.Value) : 0; inovice.CreatedBy = GlobalInfo.Userid; inovice.CreatedDate = DateTime.Now.ToString("dd/MM/yyyy"); inovice.TokanId = hftokanno.Value; inovice.TotalSchemeAmount = schemeTemp; inovice.ShecemeApplied = schemeApplied; inovice.orderType = 1;// AgentORder inovice.CurrentBoothID = GlobalInfo.CurrentbothID; inovice.PaymentMode = dpPaymentMode.SelectedItem.Text; DataSet chkds = new DataSet(); chkds = invoiceData.CheckBoothTemp(inovice, 1); if (!Comman.Comman.IsDataSetEmpty(chkds)) { result = invoiceData.BoothInserOrder(inovice); } if (result > 0) { updateStock(); btnAgentORderSubmit.Visible = false; btnPrintAgent.Visible = true; pnlBills.Visible = true; btnagentItamsremove.Visible = false; btnAddAgentProductItem.Visible = false; btnAgentNewOrder.Visible = false; btnAgentORderSubmit.Visible = false; pnlBill1.Visible = false; lblSuccess.Visible = true; divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; pnlError.Update(); upMain.Update(); pnlBill1.Enabled = false; } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblwarning.Text = "Please Contact to Site Admin"; pnlError.Update(); } }