コード例 #1
0
        private List <SqlParameter> Set_Values_In_CArticle(CArticleInfo cArticle)
        {
            List <SqlParameter> sqlParams = new List <SqlParameter>();

            if (cArticle.C_Article_Id != 0)
            {
                sqlParams.Add(new SqlParameter("@C_Article_Id", cArticle.C_Article_Id));
            }
            sqlParams.Add(new SqlParameter("@Quality_Id", cArticle.Quality_Id));
            sqlParams.Add(new SqlParameter("@Yarn_Type_Id", cArticle.Yarn_Type_Id));
            sqlParams.Add(new SqlParameter("@Weave_Id", cArticle.Weave_Id));
            sqlParams.Add(new SqlParameter("@Shade_Id", cArticle.Shade_Id));
            sqlParams.Add(new SqlParameter("@Chemical_Finish_Id", cArticle.Chemical_Finish_Id));
            sqlParams.Add(new SqlParameter("@Mechanical_Finish_Id", cArticle.Mechanical_Finish_Id));
            sqlParams.Add(new SqlParameter("@Type_Id", cArticle.Type_Id));
            sqlParams.Add(new SqlParameter("@C_Finish_Width", cArticle.C_Finish_Width));
            sqlParams.Add(new SqlParameter("@Coat", cArticle.Coat));
            sqlParams.Add(new SqlParameter("@C_gsm", cArticle.C_gsm));
            sqlParams.Add(new SqlParameter("@Full_Code", cArticle.Full_Code));
            sqlParams.Add(new SqlParameter("@Batch", cArticle.Batch));
            sqlParams.Add(new SqlParameter("@Is_Active", cArticle.Is_Active));

            if (cArticle.C_Article_Id == 0)
            {
                sqlParams.Add(new SqlParameter("@CreatedBy", cArticle.CreatedBy));
                sqlParams.Add(new SqlParameter("@CreatedOn", cArticle.CreatedOn));
            }
            sqlParams.Add(new SqlParameter("@UpdatedBy", cArticle.UpdatedBy));
            sqlParams.Add(new SqlParameter("@UpdatedOn", cArticle.UpdatedOn));

            return(sqlParams);
        }
コード例 #2
0
        public int Insert_CArticle(CArticleInfo cArticle)
        {
            int cArticle_Id = 0;

            _sqlRepo.ExecuteNonQuery(Set_Values_In_CArticle(cArticle), StoredProcedures.Insert_C_Article_Sp.ToString(), CommandType.StoredProcedure);

            return(cArticle_Id);
        }
コード例 #3
0
 public CArticleViewModel()
 {
     CArticle         = new CArticleInfo();
     CArticles        = new List <CArticleInfo>();
     Quality_List     = new List <QualityInfo>();
     Attribute_Codes  = new List <AttributeCodeInfo>();
     Friendly_Message = new List <FriendlyMessageInfo>();
     Pager            = new PaginationInfo();
     Filter           = new CArticle_Filter();
 }
コード例 #4
0
        public CArticleInfo Get_CArticle_By_Id(int cArticle_Id)
        {
            CArticleInfo cArticle = new CArticleInfo();

            List <SqlParameter> sqlparam = new List <SqlParameter>();

            sqlparam.Add(new SqlParameter("@cArticle_Id", cArticle_Id));

            DataTable dt = _sqlRepo.ExecuteDataTable(sqlparam, StoredProcedures.Get_C_Article_By_Id_Sp.ToString(), CommandType.StoredProcedure);

            List <DataRow> drList = new List <DataRow>();

            drList = dt.AsEnumerable().ToList();

            foreach (DataRow dr in drList)
            {
                cArticle = Get_CArticle_Values(dr);
            }

            return(cArticle);
        }
コード例 #5
0
        private CArticleInfo Get_CArticle_Values(DataRow dr)
        {
            CArticleInfo cArticle = new CArticleInfo();

            cArticle.C_Article_Id           = Convert.ToInt32(dr["C_Article_Id"]);
            cArticle.Quality_Id             = Convert.ToInt32(dr["Quality_Id"]);
            cArticle.Quality_No             = Convert.ToInt32(dr["Quality_No"]);
            cArticle.Yarn_Type_Id           = Convert.ToInt32(dr["Yarn_Type_Id"]);
            cArticle.Yarn_Type_Name         = Convert.ToString(dr["Yarn_Type_Name"]);
            cArticle.Weave_Id               = Convert.ToInt32(dr["Weave_Id"]);
            cArticle.Weave_Name             = Convert.ToString(dr["Weave_Name"]);
            cArticle.Shade_Id               = Convert.ToInt32(dr["Shade_Id"]);
            cArticle.Shade_Name             = Convert.ToString(dr["Shade_Name"]);
            cArticle.Chemical_Finish_Id     = Convert.ToInt32(dr["Chemical_Finish_Id"]);
            cArticle.Chemical_Finish_Name   = Convert.ToString(dr["Chemical_Finish_Name"]);
            cArticle.Mechanical_Finish_Id   = Convert.ToInt32(dr["Mechanical_Finish_Id"]);
            cArticle.Mechanical_Finish_Name = Convert.ToString(dr["Mechanical_Finish_Name"]);
            cArticle.Type_Id        = Convert.ToInt32(dr["Type_Id"]);
            cArticle.Type_Name      = Convert.ToString(dr["CType_Name"]);
            cArticle.C_Finish_Width = Convert.ToDecimal(dr["C_Finish_Width"]);
            cArticle.Coat           = Convert.ToString(dr["Coat"]);
            cArticle.C_gsm          = Convert.ToString(dr["C_gsm"]);
            cArticle.Full_Code      = Convert.ToString(dr["Full_Code"]);
            cArticle.Batch          = Convert.ToString(dr["Batch"]);
            cArticle.Is_Active      = Convert.ToBoolean(dr["Is_Active"]);
            cArticle.CreatedBy      = Convert.ToInt32(dr["CreatedBy"]);
            cArticle.CreatedOn      = Convert.ToDateTime(dr["CreatedOn"]);
            cArticle.UpdatedBy      = Convert.ToInt32(dr["UpdatedBy"]);
            cArticle.UpdatedOn      = Convert.ToDateTime(dr["UpdatedOn"]);
            //
            cArticle.Yarn_Type_Code         = Convert.ToString(dr["Yarn_Type_Code"]);
            cArticle.Weave_Code             = Convert.ToString(dr["Weave_Code"]);
            cArticle.Shade_Code             = Convert.ToString(dr["Shade_Code"]);
            cArticle.Chemical_Finish_Code   = Convert.ToString(dr["Chemical_Finish_Code"]);
            cArticle.Mechanical_Finish_Code = Convert.ToString(dr["Mechanical_Finish_Code"]);
            cArticle.Type_Code = Convert.ToString(dr["Type_Code"]);

            return(cArticle);
        }
コード例 #6
0
 public void Update_CArticle(CArticleInfo cArticle)
 {
     _cArticleRepo.Update_CArticle(cArticle);
 }
コード例 #7
0
 public int Insert_CArticle(CArticleInfo cArticle)
 {
     return(_cArticleRepo.Insert_CArticle(cArticle));
 }
コード例 #8
0
 public void Update_CArticle(CArticleInfo cArticle)
 {
     _sqlRepo.ExecuteNonQuery(Set_Values_In_CArticle(cArticle), StoredProcedures.Update_C_Article_Sp.ToString(), CommandType.StoredProcedure);
 }