public List <MasterSilhoteeTable> GetSilhoutteTableList(int UserId) { try { accessManager.SqlConnectionOpen(DataBase.QMSDatabase); List <MasterSilhoteeTable> masterSilhoutteList = new List <MasterSilhoteeTable>(); List <SqlParameter> aParameters = new List <SqlParameter>(); aParameters.Add(new SqlParameter("@UserId", UserId)); SqlDataReader dr = accessManager.GetSqlDataReader("sp_GetAllMasterSilhoutteList", aParameters); while (dr.Read()) { MasterSilhoteeTable masterInformation = new MasterSilhoteeTable(); masterInformation.MasterSilhouteeId = (int)dr["MasterSilhouteeId"]; masterInformation.StyleId = (int)dr["StyleId"]; masterInformation.StyleName = dr["StyleName"].ToString(); masterInformation.BuyerName = dr["BuyerName"].ToString(); masterInformation.UnitName = dr["UnitName"].ToString(); masterInformation.SilhouetteName = dr["SilhouetteName"].ToString(); masterInformation.UserId = (int)dr["UserId"]; masterInformation.CreateDate = dr["CreateDate"].ToString(); masterSilhoutteList.Add(masterInformation); } return(masterSilhoutteList); } catch (Exception exception) { throw exception; } finally { accessManager.SqlConnectionClose(); } }
public MasterSilhoteeTable GetMasterSilhoutteInformation(int MasterId) { try { accessManager.SqlConnectionOpen(DataBase.QMSDatabase); MasterSilhoteeTable masterInformation = new MasterSilhoteeTable(); List <SqlParameter> aParameters = new List <SqlParameter>(); aParameters.Add(new SqlParameter("@MasterSilhoutteId", MasterId)); SqlDataReader dr = accessManager.GetSqlDataReader("sp_getSilhoutteInformation", aParameters); while (dr.Read()) { masterInformation.MasterSilhouteeId = (int)dr["MasterSilhouteeId"]; masterInformation.StyleId = (int)dr["StyleId"]; masterInformation.CatagoryId = (int)dr["CatagoryId"]; masterInformation.StyleName = dr["StyleName"].ToString(); masterInformation.BuyerName = dr["BuyerName"].ToString(); masterInformation.UnitName = dr["UnitName"].ToString(); masterInformation.SilhouetteName = dr["SilhouetteName"].ToString(); masterInformation.CreateDate = dr["CreateDate"].ToString(); masterInformation.Imagelist = JsonConvert.DeserializeObject <List <StyleUploadModal> >(dr["ImageList"].ToString()); //masterInformation.SilhoutteGridList = JsonConvert.DeserializeObject<List<ShilhouteeGridTable>>(dr["ShilhoutteeGridList"].ToString()); masterInformation.FrontPositionList = JsonConvert.DeserializeObject <List <DefectPostionModel> >(dr["FrontPositionList"].ToString()); masterInformation.BackPostionList = JsonConvert.DeserializeObject <List <DefectPostionModel> >(dr["BackPostionList"].ToString()); } return(masterInformation); } catch (Exception exception) { throw exception; } finally { accessManager.SqlConnectionClose(); } }