Пример #1
0
        protected void ComboBoxCustomer_Callback(object sender, CallbackEventArgsBase e)
        {
            string       sYear    = ComboBoxYear.Text;
            string       sWeekNum = ComboBoxWeekNum.Text;
            ASPxComboBox combo    = sender as ASPxComboBox;

            if (!string.IsNullOrEmpty(sWeekNum))
            {
                combo.DataSource = HLSSOA.HLSSOACustomer(Convert.ToInt32(sYear), Convert.ToInt32(sWeekNum));
            }
            else
            {
                combo.DataSource = HLSSOA.HLSSOACustomer(Convert.ToInt32(sYear), 0);
            }

            ListBoxColumn lv = new ListBoxColumn();

            lv.Width     = 100;
            lv.FieldName = "CustAccount";
            lv.Caption   = "Customer Code";
            combo.Columns.Add(lv);

            //ListBoxColumn lt1 = new ListBoxColumn();
            //lt1.FieldName = "CustName";
            //lt1.Caption = "Customer Name";
            //lt1.Width = 200;
            //combo.Columns.Add(lt1);

            combo.ValueField = "CustAccount";
            combo.TextField  = "CustName";
            combo.DataBind();
            combo.ItemStyle.Wrap   = DevExpress.Utils.DefaultBoolean.True;
            combo.TextFormatString = "{1}";
        }
Пример #2
0
        protected void ComboBoxCustomer_Init(object sender, EventArgs e)
        {
            ASPxComboBox combo = sender as ASPxComboBox;

            combo.DataSource = HLSSOA.HLSSOACustomer(0, 0);
            ListBoxColumn lv = new ListBoxColumn();

            lv.Width     = 100;
            lv.FieldName = "CustAccount";
            lv.Caption   = "Customer Code";
            combo.Columns.Add(lv);

            ListBoxColumn lt1 = new ListBoxColumn();

            lt1.FieldName = "CustName";
            lt1.Caption   = "Customer Name";
            lt1.Width     = 200;
            combo.Columns.Add(lt1);

            combo.ValueField = "CustAccount";
            combo.TextField  = "CustName";
            combo.DataBind();
            combo.ItemStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;

            //combo.ValueType = typeof(String);
        }
        private void BindHLS()
        {
            DataTable dtRecord = HLSSOA.HLSTable();

            grdHLS.DataSource   = dtRecord;
            grdHLS.KeyFieldName = "PK";
            grdHLS.DataBind();
        }
Пример #4
0
        protected void BtnSaveSOA_Click(object sender, EventArgs e)
        {
            if (BtnSaveSOA.Text == "S A V E")
            {
                HLSSOA.Save_HLSSOA(txtSOANumber.Text, Convert.ToDateTime(txtDate.Text), Convert.ToInt32(txtYear.Text), Convert.ToInt32(txtWeekNum.Text), txtCustCode.Text, txtRemarks.Text, txtPreparedBy.Text, txtPreparedByPost.Text, txtCheckedBy.Text, txtCheckedByPost.Text, txtApprovedBy.Text, txtApprovedByPost.Text, HLSWaybillList, txtAttention.Text, txtAttentionNum.Text);

                Response.Redirect("hlsSOA.aspx");
            }
        }
Пример #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     CheckCreatorKey();
     if (!Page.IsPostBack)
     {
         HLSSOAList.DataSource   = HLSSOA.HLSSOA_List();
         HLSSOAList.KeyFieldName = "PK";
         HLSSOAList.DataBind();
     }
 }
Пример #6
0
        protected void ComboBoxWeekNum_Init(object sender, EventArgs e)
        {
            ASPxComboBox combo = sender as ASPxComboBox;

            combo.DataSource = HLSSOA.HLSSOAWeekNum(0);
            ListBoxColumn lv = new ListBoxColumn();

            lv.Width     = 0;
            lv.FieldName = "sWeekNum";
            lv.Caption   = "Select Week Number";
            combo.Columns.Add(lv);

            combo.ValueField = "sWeekNum";
            combo.TextField  = "sWeekNum";
            combo.DataBind();
            combo.ItemStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;
        }
        protected void btnPrintInv_Click(object sender, EventArgs e)
        {
            if (txtBillingInvoice.Text != "" && txtBillingDate.Text != "")
            {
                //    txtPrintBillInvDate.Value = DateTime.Now.ToString("MM/dd/yyyy");
                //    txtPrintBillInv.Text = "";
                //    PopUpControlPrintInv.HeaderText = "Print Billing Invoice";
                //    PopUpControlPrintInv.ShowOnPageLoad = true;
                //    txtPrintBillInv.Focus();
                //} else
                //{
                HLSSOA.Print_HLS_BillInv(Convert.ToInt32(Session["CreatorKey"]), txtBillingDate.Text, txtCustCode.Text, txtCustomer.Text, txtCustomerAdd.Text, txtCustTIN.Text, txtYear.Text, txtWeekNum.Text, txtPreparedBy.Text, txtApprovedBy.Text, txtSOANumber.Text);

                Session["BillInv_PrintKey"] = HLSSOA.hlsBillInvPrintKey.ToString();
                Session["DocumentViewer"]   = "HLS_BillInv";
                Response.Redirect("hlsSOA_Print.aspx");
            }
        }
Пример #8
0
        protected void ComboBoxWeekNum_Callback(object sender, CallbackEventArgsBase e)
        {
            int          sYear = Convert.ToInt32(ComboBoxYear.Text);
            ASPxComboBox combo = sender as ASPxComboBox;

            combo.DataSource = HLSSOA.HLSSOAWeekNum(sYear);
            ListBoxColumn lv = new ListBoxColumn();

            lv.Width     = 0;
            lv.FieldName = "sWeekNum";
            lv.Caption   = "Select Week Number";
            combo.Columns.Add(lv);

            combo.ValueField = "sWeekNum";
            combo.TextField  = "sWeekNum";
            combo.DataBind();
            combo.ItemStyle.Wrap   = DevExpress.Utils.DefaultBoolean.True;
            combo.TextFormatString = "{0}";
        }
Пример #9
0
        protected void CallbackPanelWaybill_Callback(object sender, CallbackEventArgsBase e)
        {
            //string sYear = ComboBoxYear.Text;
            //string sWeekNum = ComboBoxWeekNum.Text;
            string sCustCode = TextBoxCustCode.Text;

            int iYear    = 0;
            int iWeekNum = 0;

            if (!string.IsNullOrEmpty(ComboBoxYear.Text))
            {
                iYear = Convert.ToInt32(ComboBoxYear.Text);
            }
            if (!string.IsNullOrEmpty(ComboBoxWeekNum.Text))
            {
                iWeekNum = Convert.ToInt32(ComboBoxWeekNum.Text);
            }

            gridWayBill.DataSource   = HLSSOA.HLSSOAWaybills(iYear, iWeekNum, sCustCode);
            gridWayBill.KeyFieldName = "Waybill";
            gridWayBill.DataBind();
        }
        protected void BtnPrintInvOK_Click(object sender, EventArgs e)
        {
            SqlConnection  cn     = new SqlConnection(GlobalClass.SQLConnString());
            SqlCommand     cmdIns = null;
            DataTable      dt     = new DataTable();
            SqlCommand     cmd    = null;
            SqlDataAdapter adp;
            string         qry = "";

            cn.Open();
            qry            = "SELECT tbl_HLS_StatementOfAccount.* FROM tbl_HLS_StatementOfAccount WHERE (BillingInvoiceNum = '" + txtPrintBillInv.Text + "')";
            cmd            = new SqlCommand(qry);
            cmd.Connection = cn;
            adp            = new SqlDataAdapter(cmd);
            adp.Fill(dt);
            if (dt.Rows.Count == 0)
            {
                cmdIns = new SqlCommand("UPDATE tbl_HLS_StatementOfAccount SET BillingInvoiceNum = @BillingInvoiceNum, BillingInvoiceDate = @BillingInvoiceDate WHERE (SOANum = @SOANum)", cn);
                cmdIns.Parameters.AddWithValue("@SOANum", txtSOANumber.Text);
                cmdIns.Parameters.AddWithValue("@BillingInvoiceNum", txtPrintBillInv.Text);
                cmdIns.Parameters.AddWithValue("@BillingInvoiceDate", txtPrintBillInvDate.Text);
                cmdIns.ExecuteNonQuery();

                HLSSOA.Print_HLS_BillInv(Convert.ToInt32(Session["CreatorKey"]), txtPrintBillInvDate.Text, txtCustCode.Text, txtCustomer.Text, txtCustomerAdd.Text, txtCustTIN.Text, txtYear.Text, txtWeekNum.Text, txtPreparedBy.Text, txtApprovedBy.Text, txtSOANumber.Text);

                Session["BillInv_PrintKey"] = HLSSOA.hlsBillInvPrintKey.ToString();
                Session["DocumentViewer"]   = "HLS_BillInv";
                Response.Redirect("hlsSOA_Print.aspx");
            }
            else
            {
                txtError.Text = "Found duplicate invoice number.";
                PopUpControlError.HeaderText     = "Error . . .";
                PopUpControlError.ShowOnPageLoad = true;
            }
            dt.Clear();

            cn.Close();
        }
Пример #11
0
        //private void LoadSOADetails(string sSOANum)
        //{

        //}

        private void LoadAddSOA(string sTrans, string sYear, string sWeekNum, string sCustCode, string sSOANum, string sUserKey)
        {
            DataTable dt = HLSSOA.Customer_Info(sCustCode);

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow row in dt.Rows)
                {
                    txtCustCode.Text     = row["CustCode"].ToString();
                    txtCustomer.Text     = row["CustName"].ToString();
                    txtCustomerAdd.Text  = row["CustAdd"].ToString();
                    txtAttention.Text    = row["CustAtt"].ToString();
                    txtAttentionNum.Text = row["CustAttNum"].ToString();
                }
            }
            dt.Clear();

            DataTable dt1 = HLSSOA.SOA_Footer(sSOANum, sTrans);

            if (dt1.Rows.Count > 0)
            {
                foreach (DataRow row in dt1.Rows)
                {
                    txtDate.Text           = row["SOADate"].ToString();
                    txtYear.Text           = row["Year"].ToString();
                    txtWeekNum.Text        = row["WeekNum"].ToString();
                    txtSOANumber.Text      = row["SOANum"].ToString();
                    txtRemarks.Text        = row["Remarks"].ToString();
                    txtPreparedBy.Text     = row["PreparedBy"].ToString();
                    txtPreparedByPost.Text = row["PreparedByPost"].ToString();
                    txtCheckedBy.Text      = row["CheckedBy"].ToString();
                    txtCheckedByPost.Text  = row["CheckedByPost"].ToString();
                    txtApprovedBy.Text     = row["ApprovedBy"].ToString();
                    txtApprovedByPost.Text = row["ApprovedByPost"].ToString();
                }
            }
            dt1.Clear();

            HLSWaybill.DataSource   = HLSSOA.HLSSOA_Details(sSOANum, sUserKey, sCustCode, sYear, sWeekNum);
            HLSWaybill.KeyFieldName = "Waybill";
            HLSWaybill.DataBind();

            switch (sTrans)
            {
            case "Add":
            {
                Page.Title                 = "HLS - SOA (Add)";
                HLSSOATitle.InnerText      = "HLS - Statement Of Account (Add)";
                txtDate.Text               = DateTime.Now.ToString("MM/dd/yyyy");
                txtYear.Text               = sYear;
                txtWeekNum.Text            = sWeekNum;
                txtRemarks.Text            = "This is to bill the trucking services rendered for (Commodity: Fresh Bananas) Wk" + sWeekNum + ", details hereunder as follows:";
                txtDate.ReadOnly           = true;
                txtYear.ReadOnly           = true;
                txtWeekNum.ReadOnly        = true;
                txtCustomer.ReadOnly       = true;
                txtCustomerAdd.ReadOnly    = true;
                txtSOANumber.ReadOnly      = false;
                txtAttention.ReadOnly      = false;
                txtAttentionNum.ReadOnly   = false;
                txtRemarks.ReadOnly        = false;
                txtPreparedBy.ReadOnly     = false;
                txtPreparedByPost.ReadOnly = false;
                txtCheckedBy.ReadOnly      = false;
                txtCheckedByPost.ReadOnly  = false;
                txtApprovedBy.ReadOnly     = false;
                txtApprovedByPost.ReadOnly = false;
                BtnSaveSOA.Text            = "S A V E";
                //BtnSaveSOA.Enabled = true;

                HLSWaybillList.DataSource   = HLSSOA.SOAWaybill_for_Save(sUserKey);
                HLSWaybillList.KeyFieldName = "Waybill";
                HLSWaybillList.DataBind();


                break;
            }

            case "View":
            {
                Page.Title                 = "HLS - SOA (View)";
                HLSSOATitle.InnerText      = "HLS - Statement Of Account (View)";
                txtDate.ReadOnly           = true;
                txtYear.ReadOnly           = true;
                txtWeekNum.ReadOnly        = true;
                txtCustomer.ReadOnly       = true;
                txtCustomerAdd.ReadOnly    = true;
                txtSOANumber.ReadOnly      = true;
                txtAttention.ReadOnly      = true;
                txtAttentionNum.ReadOnly   = true;
                txtRemarks.ReadOnly        = true;
                txtPreparedBy.ReadOnly     = true;
                txtPreparedByPost.ReadOnly = true;
                txtCheckedBy.ReadOnly      = true;
                txtCheckedByPost.ReadOnly  = true;
                txtApprovedBy.ReadOnly     = true;
                txtApprovedByPost.ReadOnly = true;
                BtnSaveSOA.Text            = "P R I N T";
                //BtnSaveSOA.Enabled = false;

                //HLSWaybillList.DataSource = HLSSOA.SOAWaybill_for_Save(sUserKey);
                //HLSWaybillList.KeyFieldName = "Waybill";
                //HLSWaybillList.DataBind();

                break;
            }
            }
        }
Пример #12
0
 private void BindHLSList()
 {
     HLSSOAList.DataSource   = HLSSOA.HLSSOA_List();
     HLSSOAList.KeyFieldName = "PK";
     HLSSOAList.DataBind();
 }
        protected void BtnSaveSOA_Click(object sender, EventArgs e)
        {
            if (BtnSaveSOA.Text == "S A V E")
            {
                HLSSOA.Save_HLSSOA(txtSOANumber.Text, Convert.ToDateTime(txtDate.Text), Convert.ToInt32(txtYear.Text), Convert.ToInt32(txtWeekNum.Text), txtCustCode.Text, txtRemarks.Text, txtPreparedBy.Text, txtPreparedByPost.Text, txtCheckedBy.Text, txtCheckedByPost.Text, txtApprovedBy.Text, txtApprovedByPost.Text, HLSWaybillList, txtAttention.Text, txtAttentionNum.Text);

                if (HLSSOA.Saving_Error == "")
                {
                    Session["HLS_Trans"]        = "View";
                    Session["HLS_Add_Year"]     = txtYear.Text;
                    Session["HLS_Add_WeekNum"]  = txtWeekNum.Text;
                    Session["HLS_Add_CustCode"] = txtCustCode.Text;
                    Session["HLS_Add_SOANum"]   = txtSOANumber.Text;
                    Response.Redirect("hlsSOA_Add.aspx");
                }

                //Session["HLS_Add_Year"] = HLSSOAList.GetRowValues(HLSSOAList.FocusedRowIndex, "Year").ToString();
                //Session["HLS_Add_WeekNum"] = HLSSOAList.GetRowValues(HLSSOAList.FocusedRowIndex, "WeekNum").ToString();
                //Session["HLS_Add_CustCode"] = HLSSOAList.GetRowValues(HLSSOAList.FocusedRowIndex, "CustCode").ToString();
                //Session["HLS_Add_SOANum"] = HLSSOAList.GetRowValues(HLSSOAList.FocusedRowIndex, "SOANum").ToString();
                //Response.Redirect("hlsSOA_Add.aspx");
                //Response.RedirectLocation = "hlsSOA_Add.aspx";

                //Response.Redirect("hlsSOA.aspx");
            }
            if (BtnSaveSOA.Text == "Print S O A")
            {
                //ModalPopupExtenderLoading.Hide();

                HLSSOA.Print_HLS_SOA(Convert.ToInt32(Session["CreatorKey"]), HLSWaybill, txtSOANumber.Text, txtDate.Text, txtCustomer.Text, txtCustomerAdd.Text, txtAttention.Text, txtAttentionNum.Text, txtRemarks.Text, txtPreparedBy.Text, txtPreparedByPost.Text, txtCheckedBy.Text, txtCheckedByPost.Text, txtApprovedBy.Text, txtApprovedByPost.Text);

                Session["SOA_PrintKey"]   = HLSSOA.hlsSOAPrintKey.ToString();
                Session["DocumentViewer"] = "HLS_SOA";

                //View_HLS_SOA(HLSSOA.hlsSOAPrintKey);

                //SqlConnection cn = new SqlConnection(GlobalClass.SQLConnString());

                //cn.Open();
                //string query = "SELECT * FROM tbl_HLS_StatementOfAccountReport WHERE (PK = " + HLSSOA.hlsSOAPrintKey + ")";
                //SqlDataAdapter sqlAd = new SqlDataAdapter(query, cn);
                //cn.Close();

                //datasets.DataSetSOA hlsSOA = new datasets.DataSetSOA();
                //sqlAd.Fill(hlsSOA, "tbl_HLS_StatementOfAccountReport");

                //ReportDocument myRpt = new ReportDocument();
                //myRpt.Load(Server.MapPath("~/crystalrep/crystalRep_SOA.rpt"));
                //myRpt.SetDataSource(hlsSOA);
                ////myRpt.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, "hlsSOA");

                //PrintDialog dialog1 = new PrintDialog();
                //dialog1.AllowSomePages = true;
                //dialog1.AllowPrintToFile = false;

                //if (dialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                //{
                //    int copies = dialog1.PrinterSettings.Copies;
                //    int fromPage = dialog1.PrinterSettings.FromPage;
                //    int toPage = dialog1.PrinterSettings.ToPage;
                //    bool collate = dialog1.PrinterSettings.Collate;

                //    myRpt.PrintOptions.PrinterName = dialog1.PrinterSettings.PrinterName;
                //    myRpt.PrintToPrinter(copies, collate, fromPage, toPage);
                //}

                //myRpt.Dispose();
                //dialog1.Dispose();


                //myRpt.PrintToPrinter(1, false, 0, 1);

                Response.Redirect("hlsSOA_Print.aspx");
                //Response.Redirect("hlsSOA_PrintCrys.aspx");
            }
        }