Esempio n. 1
0
        private void  fillMaterialgroups()
        {
            try
            {
                string selectedCompVal = lst_company.SelectedItem.Value;
                string sql             = " select * from pos.tmatr_grp where CMP_ID = @cmp_id ";
                Dictionary <string, string> parameters = new Dictionary <string, string>();
                parameters.Add("@cmp_id", selectedCompVal);
                List <materialGroupBean> materialGroupDataSource = new List <materialGroupBean>();
                using (Material_Svc svc1 = new Material_Svc())
                {
                    materialGroupDataSource = svc1.getAllMaterialGroups(sql, parameters);
                }



                lst_MATERIAL_GRP.DataSource     = materialGroupDataSource;
                lst_MATERIAL_GRP.DataTextField  = "NAME";
                lst_MATERIAL_GRP.DataValueField = "ID";
                lst_MATERIAL_GRP.DataBind();
            }
            catch (Exception ex)
            {
                MyLog.Error(ex);
            }
        }
Esempio n. 2
0
        private TransactionResult createMaterial()
        {
            TransactionResult result = new TransactionResult();

            try
            {
                MaterialBean newMaterial = new MaterialBean();
                newMaterial.COMP_ID   = int.Parse(lst_company.SelectedValue);
                newMaterial.GRP_ID    = int.Parse(lst_matr_grp.SelectedValue);
                newMaterial.LONG_NAME = txt_material_longname.Text;
                newMaterial.MEASURE   = int.Parse(lst_measure.SelectedValue);
                newMaterial.MRP_HIGH  = int.Parse(txt_mrp_high.Text);
                newMaterial.MRP_LOW   = int.Parse(txt_mrp_low.Text);
                newMaterial.NAME      = txt_materialname.Text;
                using (Material_Svc svc = new Material_Svc())
                {
                    result = svc.createItem(newMaterial);
                }
            }
            catch (Exception ex)
            {
                myLog.Error(ex);
            }
            return(result);
        }
Esempio n. 3
0
 private void fillMaterial()
 {
     try
     {
         List <MaterialBean> materialDataSource = new List <MaterialBean>();
         using (Material_Svc svc = new Material_Svc())
         {
             int grpID = int.Parse(lst_MATERIAL_GRP.SelectedItem.Value);
             materialDataSource = svc.getAllMaterial(grpID);
         }
         lst_material.DataSource     = materialDataSource;
         lst_material.DataTextField  = "name";
         lst_material.DataValueField = "ID";
         lst_material.DataBind();
     }
     catch (Exception ex)
     {
         myLog.Error(ex);
     }
 }