Exemplo n.º 1
0
        private void frm_Edit_Finish_Product_Load(object sender, EventArgs e)
        {
            ProjectTools.LoadCbo(cbo_Created_By, DataAccessLayer.GetDataTable("Employee", ""), "Name", "Emp_ID");
            string cmd2 =
                "select [Sto_ID],[Store].[Name]as st_Name FROM dbo.Store INNER JOIN dbo.Store_Category ON dbo.Store.Sto_Cat_ID =                         dbo.Store_Category.Sto_Cat_ID  where[Store].Sto_Cat_ID=[Store_Category].Sto_Cat_ID and [Store_Category].Name='Finish'";


            ProjectTools.LoadCbo(cbo_Stock_Name, DataAccessLayer.GetDataTableComplex(cmd2, ""), "st_Name", "Sto_ID");
            ProjectTools.LoadCbo(cbo_Itm_Cat, DataAccessLayer.GetDataTable("Item_Category", ""), "Name", "Itm_Cat_ID");

            txt_Add_No.Text = DataAccessLayer.NewRowID("Add_Finish_Process", "Add_Finish_ID");
            // EnableHeadDetails(true, false);
            FormLoadFlag = true;

            try
            {
                DataRow row_Edit = DataAccessLayer.GetRowByID("Add_Finish_Process", "Add_Finish_ID", IID.ToString());
                txt_Add_No.Text = IID.ToString();
                cbo_Created_By.SelectedValue = row_Edit[1];
                txt_Notes.Text = row_Edit[3].ToString();
                cbo_Stock_Name.SelectedValue = row_Edit[4].ToString();

                dgv_Itm_Returned.Rows.Clear();

                FillTheFormDetails(DataAccessLayer.GetRowsByID("ViewFinishOrder", "Add_Finish_ID", IID.ToString()));
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message);
                throw;
            }
        }
Exemplo n.º 2
0
 private void cbo_Itm_Cat_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (FormLoadFlag)
         {
             ProjectTools.LoadCbo(cbo_Itm_Name, DataAccessLayer.GetDataTable("Item_Subcategory", " where Itm_Cat_ID = " + (cbo_Itm_Cat.SelectedValue).ToString()), "Name", "Itm_Sub_ID");
         }
     }
     catch (Exception exp)
     {
         MessageBox.Show(exp.Message);
     }
 }
Exemplo n.º 3
0
        private void Frm_SampleForm_Load(object sender, EventArgs e)
        {
            try
            {
                ProjectTools.LoadCbo(cbo_Created_By, DataAccessLayer.GetDataTable("Employee", ""), "Name", "Emp_ID");
                string cmd2 = "select [Sto_ID],[Store].[Name]as st_Name FROM dbo.Store INNER JOIN dbo.Store_Category ON dbo.Store.Sto_Cat_ID =                         dbo.Store_Category.Sto_Cat_ID  where[Store].Sto_Cat_ID=[Store_Category].Sto_Cat_ID and [Store_Category].Name='Finish'";


                ProjectTools.LoadCbo(cbo_Stock_Name, DataAccessLayer.GetDataTableComplex(cmd2, ""), "st_Name", "Sto_ID");
                ProjectTools.LoadCbo(cbo_Itm_Cat, DataAccessLayer.GetDataTable("Item_Category", ""), "Name", "Itm_Cat_ID");

                txt_Add_No.Text = DataAccessLayer.NewRowID("Add_Finish_Process", "Add_Finish_ID");
                EnableHeadDetails(true, false);
                FormLoadFlag = true;

                //if (edit_or_add == "add")
                //{


                //}
                //else if (edit_or_add == "edit")
                //{
                //    DataRow row_Edit = DataAccessLayer.GetRowByID("Add_Finish_Process", "Add_Finish_ID", IID.ToString());
                //    txt_Add_No.Text = IID.ToString();
                //    txt_Notes.Text = row_Edit[3].ToString();
                //    cbo_Created_By.SelectedValue = row_Edit[1];


                //    dgv_Itm_Returned_Edit.Rows.Clear();
                //    dgv_Itm_Returned_Edit.DataSource = DataAccessLayer.GetDataTable("ViewFinishOrder", " where Add_Finish_ID =" + IID.ToString());



                //}
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message);
            }
            //Display 4
        }
Exemplo n.º 4
0
        private void Finish_Product_Load(object sender, EventArgs e)
        {
            try
            {
                ProjectTools.LoadCbo(cbo_Created_By, DataAccessLayer.GetDataTable("Employee", ""), "Name", "Emp_ID");
                string cmd = "select [Sto_ID],[Store].[Name]as st_Name FROM dbo.Store INNER JOIN dbo.Store_Category ON dbo.Store.Sto_Cat_ID = dbo.Store_Category.Sto_Cat_ID  where[Store].Sto_Cat_ID=[Store_Category].Sto_Cat_ID and [Store_Category].Name='Finish'";
                ProjectTools.LoadCbo(cbo_Stock_Name, DataAccessLayer.GetDataTableComplex(cmd, ""), "st_Name", "Sto_ID");
                ProjectTools.LoadCbo(cbo_Itm_Cat, DataAccessLayer.GetDataTable("Item_Category", ""), "Name", "Itm_Cat_ID");
                FormLoadFlag = true;


                // txt_Add_No.Text = DataAccessLayer.NewRowID("Add_Finish_Process", "Add_Finish_ID");
                //EnableHeadDetails(true, false);
                FormLoadFlag = true;
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message);
                throw;
            }
        }