protected void Page_Load(object sender, EventArgs e)
        {
            // Set Permission
            Permission.GetPermission(Convert.ToInt32(ConstantClass.SESSION_USER_GROUP_ID), PageName);

            // Load Combobox Customer Group Data
            SPlanetUtil.BindASPxComboBox(ref cboUserGroup, DataListUtil.DropdownStoreProcedureName.Security_User_Group);

            // Setting height gridView
            gridView.Settings.VerticalScrollableHeight = Convert.ToInt32(BasePage.SizeScreen);

            //Bind Data into GridView
            if (!Page.IsPostBack)
            {
                Session.Remove("SESSION_USER_PERMISSION");
                dsResult = null;
                BindGrid(true);
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "SetCheckboxSwitch", "setTimeout(function() { setCheckboxSwitch() }, 150);", true);
                dsResult = (DataSet)ViewState["dsResult"];
                BindGrid(false);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // Load Combobox Customer Data
            SPlanetUtil.BindASPxComboBox(ref cboCustomerId, DataListUtil.DropdownStoreProcedureName.Customer);

            // Load Combobox Thailand Geo Data
            SPlanetUtil.BindASPxComboBox(ref cboGEO, DataListUtil.DropdownStoreProcedureName.Thailand_Geo);

            // Setting height gridView
            gridView.Settings.VerticalScrollableHeight = Convert.ToInt32(BasePage.SizeScreen);

            //Bind Data into GridView
            if (!Page.IsPostBack)
            {
                // Get Permission and if no permission, will redirect to another page.
                if (!Permission.GetPermission())
                {
                    Response.Redirect(ConstantClass.CONSTANT_NO_PERMISSION_PAGE);
                }

                dsResult = null;
                BindGrid(true);
            }
            else
            {
                dsResult = (DataSet)ViewState["dsResult"];
                BindGrid(false);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // Load Combobox Thailand Geo Data
            SPlanetUtil.BindASPxComboBox(ref cboGEO, DataListUtil.DropdownStoreProcedureName.Thailand_Geo);
            cboGEO.Items.Insert(0, new ListEditItem("--โปรดเลือก--", "0"));

            SPlanetUtil.BindASPxComboBox(ref cboSupplierBrand, DataListUtil.DropdownStoreProcedureName.Supplier_Brand);
            cboSupplierBrand.Items.Insert(0, new ListEditItem("--โปรดเลือก--", "0"));

            SPlanetUtil.BindASPxComboBox(ref cboSupplierGroup, DataListUtil.DropdownStoreProcedureName.Supplier_Group);
            cboSupplierGroup.Items.Insert(0, new ListEditItem("--โปรดเลือก--", "0"));

            // Setting height gridView
            gridView.Settings.VerticalScrollableHeight = Convert.ToInt32(BasePage.SizeScreen);
            gridView.SettingsBehavior.AllowFocusedRow  = true;

            //Bind Data into GridView
            if (!Page.IsPostBack)
            {
                // Get Permission and if no permission, will redirect to another page.
                if (!Permission.GetPermission())
                {
                    Response.Redirect(ConstantClass.CONSTANT_NO_PERMISSION_PAGE);
                }

                dsResult = null;
                BindGrid(true);
            }
            else
            {
                dsResult = (DataSet)Session["SESSION_SUPPLIER_MASTER"];
                BindGrid(false);
            }
        }
        protected void PrepareData()
        {
            SPlanetUtil.BindASPxComboBox(ref cbbIssue, DataListUtil.DropdownStoreProcedureName.Delivery_Order_Issue_Stock);
            //txtDeliveryOrderDate.Value = DateTime.UtcNow.ToString("dd/MM/yyyy");

            gridViewIssue.SettingsBehavior.AllowFocusedRow    = true;
            gridViewIssueMFG.SettingsBehavior.AllowFocusedRow = true;
        }
 protected void PrepareData()
 {
     try
     {
         SPlanetUtil.BindASPxComboBox(ref cbbCustomer, DataListUtil.DropdownStoreProcedureName.Customer);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #6
0
        protected void PrepareData()
        {
            // Load Combobox Product Category Data
            //SPlanetUtil.BindASPxComboBox(ref cboCateID, DataListUtil.DropdownStoreProcedureName.Product_Category);

            //// Load Combobox Product Unit Type Data
            //SPlanetUtil.BindASPxComboBox(ref cboUnitType, DataListUtil.DropdownStoreProcedureName.Product_Unit);

            // Load Combobox Product Brand Data
            //SPlanetUtil.BindASPxComboBox(ref cboBrand, DataListUtil.DropdownStoreProcedureName.Product_Brand);
            SPlanetUtil.BindASPxComboBox(ref cbbPartNoID, DataListUtil.DropdownStoreProcedureName.Part_No);
        }
Example #7
0
        // ClientInstanceName that use in Script.js
        protected void Page_Load(object sender, EventArgs e)
        {
            //Bind Data into GridView
            if (!Page.IsPostBack)
            {
                // Get Permission and if no permission, will redirect to another page.
                if (!Permission.GetPermission())
                {
                    Response.Redirect(ConstantClass.CONSTANT_NO_PERMISSION_PAGE);
                }

                Session.Remove("EMPLOYEE_FORM_IMGPATH");
                Session.Remove("EMPLOYEE_FORM_SIGN_IMGPATH");
                // Load Combobox Employee Department Data
                SPlanetUtil.BindASPxComboBox(ref cboDepartment, DataListUtil.DropdownStoreProcedureName.Employee_Department);

                // Load Combobox Employee Position Data
                SPlanetUtil.BindASPxComboBox(ref cboPosition, DataListUtil.DropdownStoreProcedureName.Employee_Position);

                // Load Combobox Province Data
                SPlanetUtil.BindASPxComboBox(ref cboProvince, DataListUtil.DropdownStoreProcedureName.Thailand_Province);

                SPlanetUtil.BindASPxComboBox(ref cboUserGroup, DataListUtil.DropdownStoreProcedureName.Security_User_Group);

                cboPrefix.Items.Add("นาย", "0");
                cboPrefix.Items.Add("นางสาว", "1");
                cboPrefix.Items.Add("นาง", "2");
                cboPrefix.Items.Add("ไม่ระบุ", "3");


                // Setting height gridView
                gridView.Settings.VerticalScrollableHeight = Convert.ToInt32(BasePage.SizeScreen);
                gridView.SettingsBehavior.AllowFocusedRow  = true;

                dsResult = null;
                BindGrid(true);
            }
            else
            {
                //Page.ClientScript.RegisterStartupScript(this.GetType(), "setCheckboxSwitch", "setTimeout(function() { setCheckboxSwitch() }, 150);", true);
                dsResult = (DataSet)Session["SESSION_EMPLOYEE_MASTER"];
                BindGrid(false);
            }
        }
Example #8
0
        protected void PrepareData()
        {
            try
            {
                var dtSource = new DataTable();
                dtSource.Columns.Add("data_value", typeof(string));
                dtSource.Columns.Add("data_text", typeof(string));
                dtSource.Rows.Add("RM", "Remind");
                dtSource.Rows.Add("RE", "Repair");
                cboNoticeType.DataSource = dtSource;
                cboNoticeType.DataBind();

                SPlanetUtil.BindASPxComboBox(ref cbbCustomerID, DataListUtil.DropdownStoreProcedureName.Customer);

                // Setting height gridView
                gridView.Settings.VerticalScrollableHeight = Convert.ToInt32(BasePage.SizeScreen);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        protected void PrepareData()
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    SPlanetUtil.BindASPxComboBox(ref cbbCustomer, DataListUtil.DropdownStoreProcedureName.Customer);
                    //SPlanetUtil.BindASPxComboBox(ref cbbEmployee, DataListUtil.DropdownStoreProcedureName.Employee_List);
                    SPlanetUtil.BindASPxComboBox(ref cbbCustomerGroup, DataListUtil.DropdownStoreProcedureName.Customer_Group);


                    using (SqlConnection conn = new SqlConnection(SPlanetUtil.GetConnectionString()))
                    {
                        //Create array of Parameters
                        List <SqlParameter> arrParm = new List <SqlParameter>
                        {
                            new SqlParameter("@type", SqlDbType.VarChar, 2)
                            {
                                Value = "A"
                            },
                        };
                        conn.Open();
                        var dsResult = SqlHelper.ExecuteDataset(conn, "sp_dropdown_quotation_type", arrParm.ToArray());

                        conn.Close();
                        cbbQuotation.DataSource = dsResult;
                        cbbQuotation.TextField  = "data_text";
                        cbbQuotation.ValueField = "data_value";
                        cbbQuotation.DataBind();
                    }

                    using (SqlConnection conn = new SqlConnection(SPlanetUtil.GetConnectionString()))
                    {
                        //Create array of Parameters
                        List <SqlParameter> arrParm = new List <SqlParameter>
                        {
                            new SqlParameter("@search_name", SqlDbType.VarChar, 200)
                            {
                                Value = ""
                            },
                            new SqlParameter("@id", SqlDbType.Int)
                            {
                                Value = 0
                            },
                        };
                        conn.Open();
                        var dsResult = SqlHelper.ExecuteDataset(conn, "sp_customer_list", arrParm.ToArray());

                        conn.Close();
                        cbbCustomerCode.DataSource = dsResult;
                        cbbCustomerCode.TextField  = "customer_code";
                        cbbCustomerCode.ValueField = "customer_code";
                        cbbCustomerCode.DataBind();
                    }



                    var dtSource = new DataTable();
                    dtSource.Columns.Add("data_value", typeof(string));
                    dtSource.Columns.Add("data_text", typeof(string));
                    dtSource.Rows.Add("FL", "Follow");
                    dtSource.Rows.Add("CF", "Confirm");
                    dtSource.Rows.Add("PO", "PO");
                    dtSource.Rows.Add("DL", "Delivery");
                    dtSource.Rows.Add("CP", "Completed");
                    dtSource.Rows.Add("LS", "Lose");
                    cbbStatus.DataSource = dtSource;
                    cbbStatus.DataBind();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #10
0
        protected void PrepareData()
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    SPlanetUtil.BindASPxComboBox(ref cbbEmployee, DataListUtil.DropdownStoreProcedureName.Employee_List);
                    SPlanetUtil.BindASPxComboBox(ref cbbCustomerGroup, DataListUtil.DropdownStoreProcedureName.Customer_Group);

                    using (SqlConnection conn = new SqlConnection(SPlanetUtil.GetConnectionString()))
                    {
                        //Create array of Parameters
                        List <SqlParameter> arrParm = new List <SqlParameter>
                        {
                            new SqlParameter("@type", SqlDbType.VarChar, 2)
                            {
                                Value = "PO"
                            },
                        };
                        conn.Open();
                        var dsResult = SqlHelper.ExecuteDataset(conn, "sp_dropdown_quotation_type", arrParm.ToArray());

                        conn.Close();
                        cbbQuotation.DataSource = dsResult;
                        cbbQuotation.TextField  = "data_text";
                        cbbQuotation.ValueField = "data_value";
                        cbbQuotation.DataBind();
                    }
                    using (SqlConnection conn = new SqlConnection(SPlanetUtil.GetConnectionString()))
                    {
                        //Create array of Parameters
                        List <SqlParameter> arrParm = new List <SqlParameter>
                        {
                            new SqlParameter("@cat_cade", SqlDbType.VarChar, 2)
                            {
                                Value = "AC"
                            },
                        };
                        conn.Open();
                        var dsResult = SqlHelper.ExecuteDataset(conn, "sp_dropdown_product_model", arrParm.ToArray());

                        conn.Close();
                        cbbAirCompressorModel.DataSource = dsResult;
                        cbbAirCompressorModel.TextField  = "product_model";
                        cbbAirCompressorModel.ValueField = "product_model";
                        cbbAirCompressorModel.DataBind();
                    }
                    using (SqlConnection conn = new SqlConnection(SPlanetUtil.GetConnectionString()))
                    {
                        //Create array of Parameters
                        List <SqlParameter> arrParm = new List <SqlParameter>
                        {
                            new SqlParameter("@cat_cade", SqlDbType.VarChar, 2)
                            {
                                Value = "D"
                            },
                        };
                        conn.Open();
                        var dsResult = SqlHelper.ExecuteDataset(conn, "sp_dropdown_product_model", arrParm.ToArray());

                        conn.Close();
                        cbbAirDryerModel.DataSource = dsResult;
                        cbbAirDryerModel.TextField  = "product_model";
                        cbbAirDryerModel.ValueField = "product_model";
                        cbbAirDryerModel.DataBind();
                    }
                    using (SqlConnection conn = new SqlConnection(SPlanetUtil.GetConnectionString()))
                    {
                        //Create array of Parameters
                        List <SqlParameter> arrParm = new List <SqlParameter>
                        {
                            new SqlParameter("@cat_cade", SqlDbType.VarChar, 2)
                            {
                                Value = "L"
                            },
                        };
                        conn.Open();
                        var dsResult = SqlHelper.ExecuteDataset(conn, "sp_dropdown_product_model", arrParm.ToArray());

                        conn.Close();
                        cbbLineFilterModel.DataSource = dsResult;
                        cbbLineFilterModel.TextField  = "product_model";
                        cbbLineFilterModel.ValueField = "product_model";
                        cbbLineFilterModel.DataBind();
                    }
                    using (SqlConnection conn = new SqlConnection(SPlanetUtil.GetConnectionString()))
                    {
                        //Create array of Parameters
                        List <SqlParameter> arrParm = new List <SqlParameter>
                        {
                            new SqlParameter("@cat_cade", SqlDbType.VarChar, 2)
                            {
                                Value = "M"
                            },
                        };
                        conn.Open();
                        var dsResult = SqlHelper.ExecuteDataset(conn, "sp_dropdown_product_model", arrParm.ToArray());

                        conn.Close();
                        cbbMistFilterModel.DataSource = dsResult;
                        cbbMistFilterModel.TextField  = "product_model";
                        cbbMistFilterModel.ValueField = "product_model";
                        cbbMistFilterModel.DataBind();
                    }
                    using (SqlConnection conn = new SqlConnection(SPlanetUtil.GetConnectionString()))
                    {
                        //Create array of Parameters
                        List <SqlParameter> arrParm = new List <SqlParameter>
                        {
                            new SqlParameter("@cat_cade", SqlDbType.VarChar, 2)
                            {
                                Value = "T"
                            },
                        };
                        conn.Open();
                        var dsResult = SqlHelper.ExecuteDataset(conn, "sp_dropdown_product_model", arrParm.ToArray());

                        conn.Close();
                        cbbAirTankModel.DataSource = dsResult;
                        cbbAirTankModel.TextField  = "product_model";
                        cbbAirTankModel.ValueField = "product_model";
                        cbbAirTankModel.DataBind();
                    }
                    using (SqlConnection conn = new SqlConnection(SPlanetUtil.GetConnectionString()))
                    {
                        //Create array of Parameters
                        List <SqlParameter> arrParm = new List <SqlParameter>
                        {
                            new SqlParameter("@cat_cade", SqlDbType.VarChar, 2)
                            {
                                Value = "O"
                            },
                        };
                        conn.Open();
                        var dsResult = SqlHelper.ExecuteDataset(conn, "sp_dropdown_product_model", arrParm.ToArray());

                        conn.Close();
                        cbbOtherModel.DataSource = dsResult;
                        cbbOtherModel.TextField  = "product_model";
                        cbbOtherModel.ValueField = "product_model";
                        cbbOtherModel.DataBind();
                    }

                    using (SqlConnection conn = new SqlConnection(SPlanetUtil.GetConnectionString()))
                    {
                        conn.Open();
                        var dsResult = SqlHelper.ExecuteDataset(conn, "sp_dropdown_product_pressure");

                        conn.Close();
                        cbbAirCompressorPresure.DataSource = dsResult;
                        cbbAirCompressorPresure.TextField  = "pressure";
                        cbbAirCompressorPresure.ValueField = "pressure";
                        cbbAirCompressorPresure.DataBind();
                    }

                    using (SqlConnection conn = new SqlConnection(SPlanetUtil.GetConnectionString()))
                    {
                        //Create array of Parameters
                        List <SqlParameter> arrParm = new List <SqlParameter>
                        {
                            new SqlParameter("@search_name", SqlDbType.VarChar, 200)
                            {
                                Value = ""
                            },
                            new SqlParameter("@id", SqlDbType.Int)
                            {
                                Value = 0
                            },
                        };
                        conn.Open();
                        var dsResult = SqlHelper.ExecuteDataset(conn, "sp_customer_list", arrParm.ToArray());

                        conn.Close();
                        cbbCustomer.DataSource = dsResult;
                        cbbCustomer.TextField  = "code_name";
                        cbbCustomer.ValueField = "id";
                        cbbCustomer.DataBind();
                    }

                    using (SqlConnection conn = new SqlConnection(SPlanetUtil.GetConnectionString()))
                    {
                        //Create array of Parameters
                        List <SqlParameter> arrParm = new List <SqlParameter>
                        {
                            new SqlParameter("@lang_id", SqlDbType.VarChar, 3)
                            {
                                Value = "tha"
                            },
                            new SqlParameter("@cat_type", SqlDbType.Int)
                            {
                                Value = "PP"
                            },
                        };
                        conn.Open();
                        var dsResult = SqlHelper.ExecuteDataset(conn, "sp_dropdown_product_category_export", arrParm.ToArray());

                        conn.Close();
                        cbbProductCat.DataSource = dsResult;
                        cbbProductCat.TextField  = "data_text";
                        cbbProductCat.ValueField = "data_value";
                        cbbProductCat.DataBind();
                    }

                    var dtSource = new DataTable();
                    dtSource.Columns.Add("data_value", typeof(string));
                    dtSource.Columns.Add("data_text", typeof(string));
                    dtSource.Rows.Add("FL", "Follow");
                    dtSource.Rows.Add("CF", "Confirm");
                    dtSource.Rows.Add("PO", "PO");
                    dtSource.Rows.Add("DL", "Delivery");
                    dtSource.Rows.Add("CP", "Completed");
                    dtSource.Rows.Add("LS", "Lose");
                    cbbStatus.DataSource = dtSource;
                    cbbStatus.DataBind();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #11
0
        protected void PrepareData()
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    SPlanetUtil.BindASPxComboBox(ref cbbShelf, DataListUtil.DropdownStoreProcedureName.Shelf_List);
                    SPlanetUtil.BindASPxComboBox(ref cbbCustomerGroup, DataListUtil.DropdownStoreProcedureName.Customer_Group);

                    using (SqlConnection conn = new SqlConnection(SPlanetUtil.GetConnectionString()))
                    {
                        //Create array of Parameters
                        List <SqlParameter> arrParm = new List <SqlParameter>
                        {
                            new SqlParameter("@type", SqlDbType.VarChar, 2)
                            {
                                Value = "MSC"
                            },
                        };
                        conn.Open();
                        var dsResult = SqlHelper.ExecuteDataset(conn, "sp_dropdown_quotation_type", arrParm.ToArray());

                        conn.Close();
                        cbbQuotation.DataSource = dsResult;
                        cbbQuotation.TextField  = "data_text";
                        cbbQuotation.ValueField = "data_value";
                        cbbQuotation.DataBind();
                    }
                    using (SqlConnection conn = new SqlConnection(SPlanetUtil.GetConnectionString()))
                    {
                        //Create array of Parameters
                        List <SqlParameter> arrParm = new List <SqlParameter>
                        {
                            new SqlParameter("@search_name", SqlDbType.VarChar, 200)
                            {
                                Value = ""
                            },
                            new SqlParameter("@id", SqlDbType.Int)
                            {
                                Value = 0
                            },
                        };
                        conn.Open();
                        var dsResult = SqlHelper.ExecuteDataset(conn, "sp_customer_list", arrParm.ToArray());

                        conn.Close();
                        cbbCustomer.DataSource = dsResult;
                        cbbCustomer.TextField  = "code_name";
                        cbbCustomer.ValueField = "id";
                        cbbCustomer.DataBind();
                    }
                    using (SqlConnection conn = new SqlConnection(SPlanetUtil.GetConnectionString()))
                    {
                        //Create array of Parameters
                        List <SqlParameter> arrParm = new List <SqlParameter>
                        {
                            new SqlParameter("@lang_id", SqlDbType.VarChar, 3)
                            {
                                Value = "tha"
                            },
                            new SqlParameter("@cat_type", SqlDbType.Int)
                            {
                                Value = "SP"
                            },
                        };
                        conn.Open();
                        var dsResult = SqlHelper.ExecuteDataset(conn, "sp_dropdown_product_category_export", arrParm.ToArray());

                        conn.Close();
                        cbbProductCat.DataSource = dsResult;
                        cbbProductCat.TextField  = "data_text";
                        cbbProductCat.ValueField = "data_value";
                        cbbProductCat.DataBind();
                    }



                    using (SqlConnection conn = new SqlConnection(SPlanetUtil.GetConnectionString()))
                    {
                        //Create array of Parameters
                        List <SqlParameter> arrParm = new List <SqlParameter>
                        {
                            new SqlParameter("@search_name", SqlDbType.VarChar, 200)
                            {
                                Value = ""
                            },
                            new SqlParameter("@customer_id", SqlDbType.Int)
                            {
                                Value = 0
                            },
                        };
                        conn.Open();
                        var dsResult = SqlHelper.ExecuteDataset(conn, "sp_customer_mfg_list", arrParm.ToArray());

                        conn.Close();
                        cbbModel.DataSource = dsResult;
                        cbbModel.TextField  = "model";
                        cbbModel.ValueField = "model";
                        cbbModel.DataBind();

                        cbbMfg.DataSource = dsResult;
                        cbbMfg.TextField  = "mfg";
                        cbbMfg.ValueField = "mfg";
                        cbbMfg.DataBind();
                    }

                    var dtSource = new DataTable();
                    dtSource.Columns.Add("data_value", typeof(string));
                    dtSource.Columns.Add("data_text", typeof(string));
                    dtSource.Rows.Add("FL", "Follow");
                    dtSource.Rows.Add("CF", "Confirm");
                    dtSource.Rows.Add("PO", "PO");
                    dtSource.Rows.Add("DL", "Delivery");
                    dtSource.Rows.Add("CP", "Completed");
                    dtSource.Rows.Add("LS", "Lose");
                    var dtSource1 = new DataTable();
                    dtSource1.Columns.Add("data_value", typeof(string));
                    dtSource1.Columns.Add("data_text", typeof(string));
                    dtSource1.Rows.Add("S", "Spare Part");
                    dtSource1.Rows.Add("M", "Maintenance");
                    dtSource1.Rows.Add("C", "Service Charge");

                    cbbproducttype.DataSource = dtSource1;
                    cbbproducttype.DataBind();

                    cbbStatus.DataSource = dtSource;
                    cbbStatus.DataBind();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }