Exemplo n.º 1
0
        public void btnAgentORderSubmit_click(object sender, EventArgs e)
        {
            totsum = 0;
            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.ROuteID           = Convert.ToInt32(dpagentRoute.SelectedItem.Value);
            inovice.SaleEmployeeId    = 0;//Convert.ToInt32(dpAgentSelasEMployee.SelectedItem.Value);
            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("MM-dd-yyyy");
            inovice.TokanId           = hftokanno.Value;
            inovice.TotalSchemeAmount = schemeTemp;
            inovice.ShecemeApplied    = schemeApplied;
            inovice.orderid           = PrvOrderID; //previous order id
            inovice.orderType         = 1;          // Agent order

            DataSet chkds  = new DataSet();
            int     chkflg = 2;

            chkds = invoiceData.CheckBoothTemp(inovice, chkflg);
            if (!Comman.Comman.IsDataSetEmpty(chkds))
            {
                result = invoiceData.InsertOrder(inovice);
            }
            if (result > 0)
            {
                btnAddAgentProductItem.Visible = false;
                btnagentItamsremove.Visible    = false;
                btnAgentORderSubmit.Visible    = false;
                clearAgentValues();
                txtagentOrderqty.Text = "0";
                BindAgntTempItam(inovice);
                divDanger.Visible   = false;
                divwarning.Visible  = false;
                divSusccess.Visible = true;
                schemeApplied       = false;
                pnlError.Update();
                PrvOrderID = 0;
                schemeTemp = 0;
                upMain.Update();
            }
            else
            {
                divDanger.Visible   = false;
                divwarning.Visible  = true;
                divSusccess.Visible = false;
                lblwarning.Text     = "Please Contact to Site Admin";
                pnlError.Update();
            }
        }
Exemplo n.º 2
0
        protected void btnemployeeOrdersubmit_click(object sender, EventArgs e)
        {
            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;
            inovice.ROuteID        = Convert.ToInt32(dpEmploueeRoute.SelectedItem.Value);
            inovice.SaleEmployeeId = 0;// Convert.ToInt32(dpEmploueeSalesPErsion.SelectedItem.Value);
            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("MM-dd-yyyy");
            inovice.TokanId        = hftokanno.Value;
            inovice.orderType      = 2;// employeeORder

            DataSet chkds  = new DataSet();
            int     chkflg = 2;

            chkds = invoiceData.CheckBoothTemp(inovice, chkflg);
            if (!Comman.Comman.IsDataSetEmpty(chkds))
            {
                result = invoiceData.InsertOrder(inovice);
            }
            if (result > 0)
            {
                btnAddEmployeeOrderItem.Visible = false;
                Button1.Visible = false;
                Button2.Visible = false;
                ClereEmployee();
                txtagentOrderqty.Text = "0";
                inovice.TokanId       = hftokanno.Value;
                inovice.CreatedBy     = GlobalInfo.Userid;
                BindEmployeeOrderDetails(inovice);
                divDanger.Visible   = false;
                divwarning.Visible  = false;
                divSusccess.Visible = true;
                pnlError.Update();
                upMain.Update();
            }
            else
            {
                divDanger.Visible   = false;
                divwarning.Visible  = true;
                divSusccess.Visible = false;
                lblwarning.Text     = "Please Contact to Site Admin";
                pnlError.Update();
            }
        }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
        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();
            }
        }
Exemplo n.º 5
0
        protected void btnCustomerordersubmit_click(object sender, EventArgs e)
        {
            pnlBills.Visible = true;
            btnCustomerorRemoveAllitam.Visible = false;
            pnlBill.Visible             = false;
            btnaddCustomeraItam.Visible = false;
            btnCustomerNewOrder.Visible = false;
            btnPrint.Visible            = true;

            int         result      = 0;
            Invoice     inovice     = new Invoice();
            InvoiceData invoiceData = new InvoiceData();

            inovice.orderDate      = (Convert.ToDateTime(txtCustamerorderDate.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.totalCoast     = string.IsNullOrEmpty(hfcutomerTotal.Value) ? 0 : Comman.Comman.IsValidInteger(hfcutomerTotal.Value) ? Convert.ToDouble(hfcutomerTotal.Value) : 0;
            inovice.CreatedBy      = GlobalInfo.Userid;
            inovice.CreatedDate    = DateTime.Now.ToString("dd/MM/yyyy");
            inovice.TokanId        = hftokanno.Value;
            inovice.orderType      = 3;// employeeORder
            inovice.CurrentBoothID = GlobalInfo.CurrentbothID;
            DataSet chkds  = new DataSet();
            int     chkflg = 1;

            chkds = invoiceData.CheckBoothTemp(inovice, chkflg);
            if (!Comman.Comman.IsDataSetEmpty(chkds))
            {
                result = invoiceData.BoothLocalInserOrder(inovice);
            }

            if (result > 0)
            {
                btnCustomerordersubmit.Visible = false;
                btnPrint.Visible = true;

                updateStock();

                //BindEmployeeOrderDetails(inovice);
                // BindAgntTempItam(inovice);
                divDanger.Visible   = false;
                divwarning.Visible  = false;
                divSusccess.Visible = true;
                pnlError.Update();
                upMain.Update();
                pnlBill.Enabled = false;


                //
            }
            else
            {
                divDanger.Visible   = false;
                divwarning.Visible  = true;
                divSusccess.Visible = false;
                lblwarning.Text     = "Please Contact to Site Admin";
                pnlError.Update();
                btnPrint.Visible = false;
                btnCustomerordersubmit.Visible = false;
                btnCustomerNewOrder.Visible    = true;
            }
        }