Ejemplo n.º 1
0
        private void ShowData(string GroupID)
        {
            mdlCompanyGroups localOblmdlCompanyGroup = new mdlCompanyGroups();
            localOblmdlCompanyGroup = ObjbllCompanyGroups.ShowData(GroupID);
            if (localOblmdlCompanyGroup.pk_GroupId != null)
            {
                txtCompanygroupid.Text = localOblmdlCompanyGroup.pk_GroupId;
                txtCompanyName.Text = localOblmdlCompanyGroup.CompanyName;
                txtgroupName.Text = localOblmdlCompanyGroup.GroupName;
                txtSeq.Text = localOblmdlCompanyGroup.Sequence;
                chkdiscontinues.Checked = localOblmdlCompanyGroup.IsDeleted;
                btnEdit.Enabled = true;
                FormMode = SelectMode;
                EnableDisable();
                txtCompanygroupid.Enabled = false;
            }
            else
            {
                MessageBox.Show("No Record Found.", "ERP - Babar Medicine Company Lahore", MessageBoxButtons.OK, MessageBoxIcon.Warning);

            }
        }
Ejemplo n.º 2
0
        public bool SaveRecord(mdlCompanyGroups ObjmdlCompanyGroup)
        {
            bool Save = false;
            try
            {
                if (con.State == ConnectionState.Open)
                {
                    con.Close();
                }
                SqlCommand cmd = new SqlCommand("stp_ERP_CompanyGroup_Crud", con);

                cmd.Parameters.Add("@pk_GroupId", SqlDbType.VarChar, 6).Value = ObjmdlCompanyGroup.pk_GroupId;
                cmd.Parameters.Add("@GroupName", SqlDbType.VarChar, 50).Value = ObjmdlCompanyGroup.GroupName;
                cmd.Parameters.Add("@Description", SqlDbType.VarChar, 100).Value = ObjmdlCompanyGroup.Description;
                cmd.Parameters.Add("@IsDeleted", SqlDbType.Bit).Value = ObjmdlCompanyGroup.IsDeleted;
                cmd.Parameters.Add("@Sequence", SqlDbType.Int).Value = ObjmdlCompanyGroup.Sequence;
                cmd.Parameters.Add("@Adduser", SqlDbType.VarChar, 25).Value = ObjmdlCompanyGroup.AddUser;
                cmd.Parameters.Add("@LoginComp", SqlDbType.VarChar, 25).Value = ObjmdlCompanyGroup.LoginComp;
                cmd.Parameters.Add("@Operation", SqlDbType.VarChar, 7).Value = "Save";
                con.Open();
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.ExecuteNonQuery();
                Save = true;
                if (con.State == ConnectionState.Open)
                {
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "ERP - Babar Medicine Company Lahore", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Save = false;
                if (con.State == ConnectionState.Open)
                {
                    con.Close();
                }
            }

            return Save;
        }
Ejemplo n.º 3
0
 public bool UpdateRecord(mdlCompanyGroups ObjmdlCompanyGroups)
 {
     return ObjdalCompanyGroup.UpdateRecord(ObjmdlCompanyGroups);
 }
Ejemplo n.º 4
0
        public mdlCompanyGroups SelectData(string pk_Groupid)
        {
            mdlCompanyGroups ObjmdlCompanyGroup = new mdlCompanyGroups();
            try
            {
                DataTable dt = new DataTable();
                if (con.State == ConnectionState.Open)
                {
                    con.Close();
                }
                con.Open();

                SqlCommand cmd = new SqlCommand("stp_ERP_CompanyGroup_Crud", con);
                cmd.Parameters.Add("@pk_GroupId", SqlDbType.VarChar, 9).Value = pk_Groupid;
                cmd.Parameters.Add("@Operation", SqlDbType.VarChar, 7).Value = "Select";
                cmd.CommandType = CommandType.StoredProcedure;
                SqlDataReader dr = cmd.ExecuteReader();
                if (dr.Read())
                {
                    ObjmdlCompanyGroup.pk_GroupId = (dr["Groupid"].ToString());
                    ObjmdlCompanyGroup.CompanyName = (dr["CompanyName"].ToString());
                    ObjmdlCompanyGroup.GroupName = (dr["GroupName"].ToString());
                    ObjmdlCompanyGroup.Description = (dr["Description"].ToString());
                    ObjmdlCompanyGroup.IsDeleted = (Convert.ToBoolean(dr["IsDeleted"]));
                    ObjmdlCompanyGroup.Sequence = (dr["Sequence"].ToString());
                }
                dr.Close();
                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 ObjmdlCompanyGroup;
        }
Ejemplo n.º 5
0
 public bool SaveRecord(mdlCompanyGroups ObjmdlCompanyGroups)
 {
     return ObjdalCompanyGroup.SaveRecord(ObjmdlCompanyGroups);
 }