Esempio n. 1
0
 public DataTable Search(mdlModulesList obj_mdlModulesList)
 {
     DataTable dt = new DataTable();
     dt = obj_dalModulesList.Search(obj_mdlModulesList);
     return dt;
 }
Esempio n. 2
0
 public bool UpdateModulesList(mdlModulesList obj_mdlModulesList)
 {
     Updated = obj_dalModulesList.UpdateModulesList(obj_mdlModulesList);
     return Updated;
 }
Esempio n. 3
0
 public bool InsertModulesList(mdlModulesList obj_mdlModulesList)
 {
     Inserted = obj_dalModulesList.InsertModulesList(obj_mdlModulesList);
     return Inserted;
 }
Esempio n. 4
0
 public int GetMaxID(mdlModulesList obj_mdlModulesList)
 {
     int CountID = 0;
     return CountID = obj_dalModulesList.GetMaxID(obj_mdlModulesList);
 }
Esempio n. 5
0
 public bool UpdateModulesList(mdlModulesList obj_mdlModulesList)
 {
     bool Updated = false;
     try
     {
         SqlCommand cmd = new SqlCommand("stp_ERP_ModulesList_Update", conn);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.Add("@ModuleID", SqlDbType.Int).Value = obj_mdlModulesList.ModuleID;
         cmd.Parameters.Add("@ModuleName", SqlDbType.VarChar, 100).Value = obj_mdlModulesList.ModuleName;
         cmd.Parameters.Add("@ModuleType", SqlDbType.VarChar, 20).Value = obj_mdlModulesList.ModuleType;
         cmd.Parameters.Add("@ModuleCategory", SqlDbType.VarChar, 50).Value = obj_mdlModulesList.ModuleCategory;
         cmd.Parameters.Add("@FormName", SqlDbType.VarChar, 100).Value = obj_mdlModulesList.FormName;
         cmd.Parameters.Add("@Discontinued", SqlDbType.Bit).Value = obj_mdlModulesList.IsDiscontinued;
         if (conn.State == ConnectionState.Open)
         {
             conn.Close();
         }
         conn.Open();
         cmd.ExecuteNonQuery();
         if (conn.State == ConnectionState.Open)
         {
             conn.Close();
             Updated = true;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "ERP - Babar Medicine Company Lahore", MessageBoxButtons.OK, MessageBoxIcon.Error);
         if (conn.State == ConnectionState.Open)
         {
             conn.Close();
         }
     }
     return Updated;
 }
Esempio n. 6
0
 public DataTable Search(mdlModulesList obj_mdlModulesList)
 {
     DataTable dt = new DataTable();
     try
     {
         if (conn.State == ConnectionState.Open)
         {
             conn.Close();
         }
         conn.Open();
         SqlDataAdapter ad = new SqlDataAdapter("stp_ERP_ModulesList_Select", conn);
         ad.SelectCommand.CommandType = CommandType.StoredProcedure;
         ad.SelectCommand.Parameters.Add("@ModuleID", SqlDbType.Int).Value = obj_mdlModulesList.ModuleID;
         ad.Fill(dt);
         if (conn.State == ConnectionState.Open)
         {
             conn.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "ERP - Babar Medicine Company Lahore", MessageBoxButtons.OK, MessageBoxIcon.Error);
         if (conn.State == ConnectionState.Open)
         {
             conn.Close();
         }
     }
     return dt;
 }
Esempio n. 7
0
 public int GetMaxID(mdlModulesList obj_mdlModulesList)
 {
     int CountID = 0;
     try
     {
         SqlCommand cmd = new SqlCommand("SELECT COALESCE(MAX(ModuleID), 0) FROM M_ERP_ModulesList", conn);
         if (conn.State == ConnectionState.Open)
         {
             conn.Close();
         }
         conn.Open();
         CountID = Convert.ToInt32(cmd.ExecuteScalar()) + 1;
         if (conn.State == ConnectionState.Open)
         {
             conn.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "ERP - Babar Medicine Company Lahore", MessageBoxButtons.OK, MessageBoxIcon.Error);
         if (conn.State == ConnectionState.Open)
         {
             conn.Close();
         }
     }
     return CountID;
 }