protected void PopulateMemberGroup()
 {
     BusinessLayer.Common.MemberGroup objMemberGroup = new BusinessLayer.Common.MemberGroup();
     memberGroup = objMemberGroup.GetMemberGroupById(MemberGroupId);
     if (memberGroup != null)
     {
         MemberGroupId           = memberGroup.MemberGroupId;
         txtMemberGroupName.Text = memberGroup.MemberGroupName.ToString();
         txtRemarks.Text         = memberGroup.Remarks.ToString();
         Message.Show            = false;
         btnSave.Text            = "Update";
     }
 }
        public static Entity.Common.MemberGroup GetMemberGroupById(int memberGroupId)
        {
            using (DataManager oDm = new DataManager())
            {
                oDm.CommandType = CommandType.StoredProcedure;

                oDm.Add("@pMemberGroupId", SqlDbType.Int, ParameterDirection.Input, memberGroupId);

                SqlDataReader dr = oDm.ExecuteReader("MemberGroup_GetById");

                Entity.Common.MemberGroup memberGroup = new Entity.Common.MemberGroup();
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        memberGroup.MemberGroupId   = memberGroupId;
                        memberGroup.MemberGroupName = (dr[1] == DBNull.Value) ? "" : dr[1].ToString();
                        memberGroup.Remarks         = (dr[2] == DBNull.Value) ? "" : dr[2].ToString();
                    }
                }
                return(memberGroup);
            }
        }
        public static void Save(Entity.Common.MemberGroup membergroup)
        {
            using (DataManager oDm = new DataManager())
            {
                oDm.Add("@pMemberGroupId", SqlDbType.Int, ParameterDirection.InputOutput, membergroup.MemberGroupId);
                oDm.Add("@pMemberGroupName", SqlDbType.VarChar, 50, membergroup.MemberGroupName);
                if (membergroup.Remarks == string.Empty)
                {
                    oDm.Add("@pRemarks", SqlDbType.VarChar, 200, string.Empty);
                }
                else
                {
                    oDm.Add("@pRemarks", SqlDbType.VarChar, 200, membergroup.Remarks);
                }


                oDm.CommandType = CommandType.StoredProcedure;

                oDm.ExecuteNonQuery("MemberGroup_Save");

                membergroup.MemberGroupId = (int)oDm["@pMemberGroupId"].Value;
            }
        }
Beispiel #4
0
 public void Save(Entity.Common.MemberGroup membergroup)
 {
     DataAccess.Common.MemberGroup.Save(membergroup);
 }