Ejemplo n.º 1
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;
            }
        }