public int Insert_YArticle(YArticleInfo yArticle) { int yArticle_Id = 0; yArticle_Id = Convert.ToInt32(_sqlRepo.ExecuteScalerObj(Set_Values_In_YArticle(yArticle), StoredProcedures.Insert_Y_Article_sp.ToString(), CommandType.StoredProcedure)); return(yArticle_Id); }
public YArticleViewModel() { YArticles = new List <YArticleInfo>(); YArticle = new YArticleInfo(); Friendly_Message = new List <FriendlyMessageInfo>(); Pager = new PaginationInfo(); Filter = new YArticle_Filter(); Attribute_Codes = new List <AttributeCodeInfo>(); Is_Primary = false; }
public YArticleInfo Get_YArticle_By_Id(int yArticle_Id) { YArticleInfo yArticle = new YArticleInfo(); List <SqlParameter> sqlparam = new List <SqlParameter>(); sqlparam.Add(new SqlParameter("@yArticle_Id", yArticle_Id)); DataTable dt = _sqlRepo.ExecuteDataTable(sqlparam, StoredProcedures.Get_Y_Article_By_Id_sp.ToString(), CommandType.StoredProcedure); List <DataRow> drList = new List <DataRow>(); drList = dt.AsEnumerable().ToList(); foreach (DataRow dr in drList) { yArticle = Get_YArticle_Values(dr); } return(yArticle); }
public List <SqlParameter> Set_Values_In_YArticle(YArticleInfo yArticle) { List <SqlParameter> sqlparam = new List <SqlParameter>(); if (yArticle.Y_Article_Id != 0) { sqlparam.Add(new SqlParameter("@Y_Article_Id", yArticle.Y_Article_Id)); } sqlparam.Add(new SqlParameter("@Denier_Id", yArticle.Denier_Id)); sqlparam.Add(new SqlParameter("@Twist_Mingle_Id", yArticle.Twist_Mingle_Id)); sqlparam.Add(new SqlParameter("@Twist_Type_Id", yArticle.Twist_Type_Id)); sqlparam.Add(new SqlParameter("@Ply_Id", yArticle.Ply_Id)); sqlparam.Add(new SqlParameter("@Yarn_Type_Id", yArticle.Yarn_Type_Id)); sqlparam.Add(new SqlParameter("@Shade_Id", yArticle.Shade_Id)); sqlparam.Add(new SqlParameter("@Filaments_Id", yArticle.Filaments_Id)); sqlparam.Add(new SqlParameter("@Origin_Id", yArticle.Origin_Id)); sqlparam.Add(new SqlParameter("@Shrinkage_Id", yArticle.Shrinkage_Id)); sqlparam.Add(new SqlParameter("@Tenasity_Id", yArticle.Tenasity_Id)); sqlparam.Add(new SqlParameter("@Chemical_Treatment_Id", yArticle.Chemical_Treatment_Id)); sqlparam.Add(new SqlParameter("@Colour_Id", yArticle.Colour_Id)); sqlparam.Add(new SqlParameter("@Supplier_Id", yArticle.Supplier_Id)); sqlparam.Add(new SqlParameter("@Full_Code", yArticle.Full_Code)); sqlparam.Add(new SqlParameter("@Given_By_Id", yArticle.Given_By_Id)); sqlparam.Add(new SqlParameter("@Validated_By_Id", yArticle.Validated_By_Id)); sqlparam.Add(new SqlParameter("@Developed_Under_Id", yArticle.Developed_Under_Id)); sqlparam.Add(new SqlParameter("@Lead_Time_To_Purchase", yArticle.Lead_Time_To_Purchase)); sqlparam.Add(new SqlParameter("@Work_Center_Id", yArticle.Work_Center_Id)); sqlparam.Add(new SqlParameter("@Is_Active", yArticle.Is_Active)); if (yArticle.Y_Article_Id == 0) { sqlparam.Add(new SqlParameter("@CreatedBy", yArticle.CreatedBy)); } sqlparam.Add(new SqlParameter("@UpdatedBy", yArticle.UpdatedBy)); return(sqlparam); }
public void Update_YArticle(YArticleInfo yArticle) { yArticleRepo.Update_YArticle(yArticle); }
public int Insert_YArticle(YArticleInfo yArticle) { return(yArticleRepo.Insert_YArticle(yArticle)); }
public void Update_YArticle(YArticleInfo yArticle) { _sqlRepo.ExecuteNonQuery(Set_Values_In_YArticle(yArticle), StoredProcedures.Update_Y_Article_sp.ToString(), CommandType.StoredProcedure); }
public YArticleInfo Get_YArticle_Values(DataRow dr) { YArticleInfo yArticle = new YArticleInfo(); yArticle.Y_Article_Id = Convert.ToInt32(dr["Y_Article_Id"]); yArticle.Denier_Id = Convert.ToInt32(dr["Denier_Id"]); yArticle.Twist_Mingle_Id = Convert.ToInt32(dr["Twist_Mingle_Id"]); yArticle.Twist_Type_Id = Convert.ToInt32(dr["Twist_Type_Id"]); yArticle.Ply_Id = Convert.ToInt32(dr["Ply_Id"]); yArticle.Yarn_Type_Id = Convert.ToInt32(dr["Yarn_Type_Id"]); yArticle.Shade_Id = Convert.ToInt32(dr["Shade_Id"]); yArticle.Filaments_Id = Convert.ToInt32(dr["Filaments_Id"]); yArticle.Origin_Id = Convert.ToInt32(dr["Origin_Id"]); yArticle.Shrinkage_Id = Convert.ToInt32(dr["Shrinkage_Id"]); yArticle.Tenasity_Id = Convert.ToInt32(dr["Tenasity_Id"]); yArticle.Chemical_Treatment_Id = Convert.ToInt32(dr["Chemical_Treatment_Id"]); yArticle.Colour_Id = Convert.ToInt32(dr["Colour_Id"]); yArticle.Supplier_Id = Convert.ToInt32(dr["Supplier_Id"]); yArticle.Full_Code = Convert.ToString(dr["Full_Code"]); yArticle.Given_By_Id = Convert.ToInt32(dr["Given_By_Id"]); yArticle.Validated_By_Id = Convert.ToInt32(dr["Validated_By_Id"]); yArticle.Developed_Under_Id = Convert.ToInt32(dr["Developed_Under_Id"]); yArticle.Lead_Time_To_Purchase = Convert.ToString(dr["Lead_Time_To_Purchase"]); yArticle.Work_Center_Id = Convert.ToInt32(dr["Work_Center_Id"]); yArticle.Is_Active = Convert.ToBoolean(dr["Is_Active"]); yArticle.CreatedBy = Convert.ToInt32(dr["CreatedBy"]); yArticle.CreatedOn = Convert.ToDateTime(dr["CreatedOn"]); yArticle.UpdatedBy = Convert.ToInt32(dr["UpdatedBy"]); yArticle.UpdatedOn = Convert.ToDateTime(dr["UpdatedOn"]); yArticle.Denier_Name = Convert.ToString(dr["Denier_Name"]); yArticle.Twist_Mingle_Name = Convert.ToString(dr["Twist_Mingle_Name"]); yArticle.Twist_Type_Name = Convert.ToString(dr["Twist_Type_Name"]); yArticle.Ply_Name = Convert.ToString(dr["Ply_Name"]); yArticle.Yarn_Type_Name = Convert.ToString(dr["Yarn_Type_Name"]); yArticle.Shade_Name = Convert.ToString(dr["Shade_Name"]); yArticle.Filaments_Name = Convert.ToString(dr["Filaments_Name"]); yArticle.Shrinkage_Name = Convert.ToString(dr["Shrinkage_Name"]); yArticle.Tenasity_Name = Convert.ToString(dr["Tenasity_Name"]); yArticle.Chemical_Treatment_Name = Convert.ToString(dr["Chemical_Treatment_Name"]); yArticle.Colour_Name = Convert.ToString(dr["Colour_Name"]); yArticle.Supplier_Name = Convert.ToString(dr["Supplier_Name"]); yArticle.Origin_Name = Convert.ToString(dr["Origin_Name"]); yArticle.Developed_Under_Name = Convert.ToString(dr["Developed_Under_Name"]); yArticle.Validated_By_Name = Convert.ToString(dr["Validated_By_Name"]); yArticle.Given_By_Name = Convert.ToString(dr["Given_By_Name"]); yArticle.Work_Center_Code = Convert.ToString(dr["Work_Center_Code"]); // yArticle.Denier_Code = Convert.ToString(dr["Denier_Code"]); yArticle.Twist_Mingle_Code = Convert.ToString(dr["Twist_Mingle_Code"]); yArticle.Twist_Type_Code = Convert.ToString(dr["Twist_Type_Code"]); yArticle.Ply_Code = Convert.ToString(dr["Ply_Code"]); yArticle.Yarn_Type_Code = Convert.ToString(dr["Yarn_Type_Code"]); yArticle.Shade_Code = Convert.ToString(dr["Shade_Code"]); yArticle.Filaments_Code = Convert.ToString(dr["Filaments_Code"]); yArticle.Shrinkage_Code = Convert.ToString(dr["Shrinkage_Code"]); yArticle.Tenasity_Code = Convert.ToString(dr["Tenasity_Code"]); yArticle.Chemical_Treatment_Code = Convert.ToString(dr["Chemical_Treatment_Code"]); yArticle.Colour_Code = Convert.ToString(dr["Colour_Code"]); yArticle.Supplier_Code = Convert.ToString(dr["Supplier_Code"]); yArticle.Origin_Code = Convert.ToString(dr["Origin_Code"]); return(yArticle); }