コード例 #1
0
ファイル: MaterialType.aspx.cs プロジェクト: mzrokz/LssTms
 protected void btnSubmit_OnClick(object sender, EventArgs e)
 {
     int res = 0;
     var oMatType = new TMSLibrary.MaterialType();
     oMatType.MaterialTypeName = txtMaterialTypeName.Text;
     if (_matTypeId == 0)
     {
         res = MasterDataMethods.AddMaterialType(oMatType);
     }
     else if (_matTypeId > 0)
     {
         oMatType.MaterialTypeID = _matTypeId;
         res = MasterDataMethods.UpdateMaterialType(oMatType);
     }
     if (res > 0)
     {
         ClearInputs(Page.Controls);
         FillGrid();
         _matTypeId = 0;
         ValidatePopup("Operation Successfull");
     }
     else
     {
         ValidatePopup("Please Try Again");
     }
 }
コード例 #2
0
ファイル: MasterDataMethods.cs プロジェクト: mzrokz/LssTms
 /// <summary>
 /// Adds a material type.
 /// </summary>
 /// <param name="oMatType"></param>
 /// <returns></returns>
 public static int AddMaterialType(MaterialType oMatType)
 {
     return TMSDataLibrary.MasterData.AddMaterialType(oMatType.MaterialTypeName);
 }
コード例 #3
0
ファイル: MasterDataMethods.cs プロジェクト: mzrokz/LssTms
 /// <summary>
 /// Updates a material type.
 /// </summary>
 /// <param name="oMatType"></param>
 /// <returns></returns>
 public static int UpdateMaterialType(MaterialType oMatType)
 {
     return TMSDataLibrary.MasterData.UpdateMaterialType(oMatType.MaterialTypeID, oMatType.MaterialTypeName);
 }
コード例 #4
0
ファイル: MasterDataMethods.cs プロジェクト: mzrokz/LssTms
 /// <summary>
 /// Get  Materialtype list
 /// </summary>
 /// <returns></returns>
 public static List<MaterialType> GetAllMaterialtype()
 {
     List<MaterialType> materialTypelist = new List<MaterialType>();
     DataTable dt = TMSDataLibrary.MasterData.GetMaterialType();
     if (dt.Rows.Count > 0)
     {
         int count = dt.Rows.Count;
         for (int i = 0; i < count; i++)
         {
             MaterialType _materialtype = new MaterialType();
             _materialtype.MaterialTypeID = Convert.ToInt32(dt.Rows[i][CONSTS.MaterialtypeColumnIndex.MaterialtypeId]);
             _materialtype.MaterialTypeName = (dt.Rows[i][CONSTS.MaterialtypeColumnIndex.MaterialtypeName]).ToString();
             materialTypelist.Add(_materialtype);
         }
     }
     return materialTypelist;
 }