private void SetValues(String sm_Area) { try { M_AreaDL objm_AreaDL = new M_AreaDL(); M_Area objm_Area = new M_Area(); if (sm_Area != "") { objm_Area.AreaCode = sm_Area; objm_Area = objm_AreaDL.Selectm_Area(objm_Area); if (objm_Area != null) { txt_AreaCode.Text = objm_Area.AreaCode.ToString(); //txt_Compcode.Text = "";// objm_Area.Compcode.ToString(); //txt_Locacode.Text = objm_Area.Locacode.ToString(); txt_Descri.Text = objm_Area.Descri.ToString(); //txt_Datex.Text = objm_Area.Datex.ToString(); //txt_Userx.Text = objm_Area.Userx.ToString(); formMode = 3; } } } catch (Exception ex) { throw ex; } }
private void button1_Click(object sender, EventArgs e) { if (txt_AreaCode.Text.Trim() != "" && txt_Areaname.Text.Trim() != "") { if (UserDefineMessages.ShowMsg("", UserDefineMessages.Msg_PerfmBtn_Save, commonFunctions.Softwarename.Trim()) == System.Windows.Forms.DialogResult.Yes) { if (M_AreaDL.ExistingM_Area(txt_AreaCode.Text.Trim())) { M_Area cat = new M_Area(); cat.AreaCode = txt_AreaCode.Text.Trim(); M_AreaDL dl = new M_AreaDL(); cat = dl.Selectm_Area(cat); txt_AreaCode.Text = cat.AreaCode.Trim(); txt_Areaname.Text = cat.Descri; } else { M_Area objm_Category = new M_Area(); objm_Category.AreaCode = txt_AreaCode.Text.Trim(); objm_Category.Descri = txt_Areaname.Text.Trim(); objm_Category.Datex = DateTime.Now; objm_Category.Locacode = ""; objm_Category.Userx = commonFunctions.Loginuser; objm_Category.Compcode = commonFunctions.GlobalCompany; objm_Category.Userx = commonFunctions.Loginuser; M_AreaDL bal = new M_AreaDL(); bal.SaveM_AreaSP(objm_Category, 1); } } } }
private void FindExisitingCategory() { if (M_AreaDL.ExistingM_Area(txt_AreaCode.Text.Trim())) { M_Area cat = new M_Area(); cat.AreaCode = txt_AreaCode.Text.Trim(); M_AreaDL dl = new M_AreaDL(); cat = dl.Selectm_Area(cat); txt_AreaCode.Text = cat.AreaCode.Trim(); txt_Areaname.Text = cat.Descri; } else { txt_Areaname.Text = "<Area Not Exists.>"; } }