Esempio n. 1
0
 public bool UpdateGroup(mdlGroup obj_mdlGroup)
 {
     bool Update = false;
     try
     {
         if (con.State == ConnectionState.Open)
         {
             con.Close();
         }
         SqlCommand cmd = new SqlCommand("stp_ERP_Group_CRUD", con);
         cmd.Parameters.Add("@pk_GroupID", SqlDbType.VarChar, 9).Value = obj_mdlGroup.Group_ID;
         cmd.Parameters.Add("@GroupName", SqlDbType.VarChar, 20).Value = obj_mdlGroup.GroupName;
         cmd.Parameters.Add("@Description", SqlDbType.VarChar, 100).Value = obj_mdlGroup.Description;
         cmd.Parameters.Add("@IsDiscontinue", SqlDbType.Bit).Value = obj_mdlGroup.IsDiscontinue;
         cmd.Parameters.Add("@AddUser", SqlDbType.VarChar, 20).Value = obj_mdlGroup.AddUser;
         cmd.Parameters.Add("@Operation", SqlDbType.VarChar, 10).Value = "Update";
         cmd.Parameters.Add("@AddComputer", SqlDbType.VarChar, 20).Value = obj_mdlGroup.LoginComputer;
         con.Open();
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.ExecuteNonQuery();
         Update = true;
         if (con.State == ConnectionState.Open)
         {
             con.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "ERP - Babar Medicine Company Lahore", MessageBoxButtons.OK, MessageBoxIcon.Error);
         Update = false;
         if (con.State == ConnectionState.Open)
         {
             con.Close();
         }
     }
     return Update;
 }
Esempio n. 2
0
 public DataTable SelectAllGroups(mdlGroup obj_mdlGroup)
 {
     DataTable dt = new DataTable();
     try
     {
         if (con.State == ConnectionState.Open)
         {
             con.Close();
         }
         con.Open();
         SqlDataAdapter ad = new SqlDataAdapter("stp_ERP_SaleInvoice_Group_Select", con);
         ad.SelectCommand.CommandType = CommandType.StoredProcedure;
         ad.Fill(dt);
         if (con.State == ConnectionState.Open)
         {
             con.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "ERP - Babar Medicine Company Lahore", MessageBoxButtons.OK, MessageBoxIcon.Error);
         if (con.State == ConnectionState.Open)
         {
             con.Close();
         }
     }
     return dt;
 }
Esempio n. 3
0
 public DataTable SelectAllGroups(mdlGroup obj_mdlGroup)
 {
     DataTable dt = new DataTable();
     dt = obj_dalGroup.SelectAllGroups(obj_mdlGroup);
     return dt;
 }
Esempio n. 4
0
 public bool UpdateGroup(mdlGroup obj_mdlGroup)
 {
     return obj_dalGroup.UpdateGroup(obj_mdlGroup);
 }
Esempio n. 5
0
 public bool SaveGroup(mdlGroup obj_mdlGroup)
 {
     return obj_dalGroup.SaveGroup(obj_mdlGroup);
 }