Example #1
0
        //거래처 등록 메서드
        /// <summary>
        /// 거래처 등록하는 메서드
        /// </summary>
        /// <param name="OffName">거래처 이름</param>
        /// <param name="OwnerName">대표자이름</param>
        /// <param name="OffAddr">대표 주소</param>
        /// <param name="mgr">담당 매니저</param>
        /// <param name="mgrMobile">매니저 번호</param>
        /// <param name="OffMobile">회사 번호</param>
        /// <returns>결과 메시지 반환</returns>
        internal string OffInsert(string OffName, string OwnerName, string OffAddr, string mgr, string mgrMobile, string OffMobile)
        {
            string sp = "Bom_JW_OffInsert";

            SqlParameter[] sqlParameters;
            int            sqlParameterSize = 5;
            string         result           = "";

            if (OffMobile != null)
            {
                sqlParameterSize++;
            }
            sqlParameters    = new SqlParameter[sqlParameterSize];
            sqlParameters[0] = new SqlParameter("@OffName", OffName);
            sqlParameters[1] = new SqlParameter("@OwnerName", OwnerName);
            sqlParameters[2] = new SqlParameter("@OffAddr", OffAddr);
            sqlParameters[3] = new SqlParameter("@offMgrName", mgr);
            sqlParameters[4] = new SqlParameter("@OffMgrPhone", mgrMobile);
            if (OffMobile != null)
            {
                sqlParameters[5] = new SqlParameter("@OwnerPhone", OffMobile);
            }

            if (dbp.ExecuteParameters(sp, sqlParameters) != 0)
            {
                result = "등록성공";
            }
            else
            {
                result = "등록실패";
            }
            return(result);
        }
Example #2
0
        /// <summary>
        /// BOM등록 하는 메서드
        /// </summary>
        /// <param name="parentMatNo">부모 자재의 자재 번호</param>
        /// <param name="childMatNo">자식 자재의 자재 번호</param>
        /// <param name="childMatEA">필요 자식 자재 개수</param>
        /// <returns>등록이 성공인지 실패인지 여부를 반환</returns>
        internal bool InsertBom(string parentMatNo, string childMatNo, string childMatEA)
        {
            string sp = "Bom_Bom_Insert_Procedure";

            SqlParameter[] sqlParameters = new SqlParameter[3];
            sqlParameters[0] = new SqlParameter("@BOM_ParentNo", Int32.Parse(parentMatNo));
            sqlParameters[1] = new SqlParameter("@BOM_ChildNo", Int32.Parse(childMatNo));
            sqlParameters[2] = new SqlParameter("@BOM_ChildEA", Int32.Parse(childMatEA));

            bool result = false;

            if (con.ExecuteParameters(sp, sqlParameters) != -1)
            {
                result = true;
            }
            else
            {
                result = false;
            }
            return(result);
        }
Example #3
0
 public void InsertMat(int mat_No, int mat_Type_No, string mat_Manufactur, string mat_Name, int mat_Cost, int mat_Level, int mat_EA, int off_No)
 {
     try
     {
         string         sp            = "Materials_Insert_Procedure";
         SqlParameter[] sqlParameters = new SqlParameter[8];
         sqlParameters[0] = new SqlParameter("@mat_No", mat_No);
         sqlParameters[1] = new SqlParameter("@mat_Type_No", mat_Type_No);
         sqlParameters[2] = new SqlParameter("@mat_Manufactur", mat_Manufactur);
         sqlParameters[3] = new SqlParameter("@mat_Name", mat_Name);
         sqlParameters[4] = new SqlParameter("@mat_Cost", mat_Cost);
         sqlParameters[5] = new SqlParameter("@mat_Level", mat_Level);
         sqlParameters[6] = new SqlParameter("@mat_EA", mat_EA);
         sqlParameters[7] = new SqlParameter("@off_No", off_No);
         dp.ExecuteParameters(sp, sqlParameters);
     }
     catch (SqlException)
     {
         throw;
     }
 }
Example #4
0
        public int InsertOrder(int off_Order_OrderNo, int mat_No, int off_Order_EA, int off_No)
        {
            try
            {
                string         sp            = "Offerer_Order_Insert_Procedure";
                SqlParameter[] sqlParameters = new SqlParameter[4];
                sqlParameters[0] = new SqlParameter("@off_Order_OrderNo", off_Order_OrderNo);
                sqlParameters[1] = new SqlParameter("mat_No", mat_No);
                sqlParameters[2] = new SqlParameter("off_Order_EA", off_Order_EA);
                sqlParameters[3] = new SqlParameter("off_No", off_No);

                return(dp.ExecuteParameters(sp, sqlParameters));
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #5
0
 public int InsertProducts(int mat_TypeNo, string mat_Name, int mat_Cost, int pro_Price, string pro_Name, string pro_Spec, byte[] pro_Img)
 {
     try
     {
         string         sp            = "Products_Insert_Procedure";
         SqlParameter[] sqlParameters = new SqlParameter[7];
         sqlParameters[0] = new SqlParameter("@mat_TypeNo", mat_TypeNo);
         sqlParameters[1] = new SqlParameter("@mat_Name", mat_Name);
         sqlParameters[2] = new SqlParameter("@mat_Cost", mat_Cost);
         sqlParameters[3] = new SqlParameter("@pro_Price", pro_Price);
         sqlParameters[4] = new SqlParameter("@pro_Name", pro_Name);
         sqlParameters[5] = new SqlParameter("@pro_Spec", pro_Spec);
         sqlParameters[6] = new SqlParameter("@pro_Img", pro_Img);
         return(dp.ExecuteParameters(sp, sqlParameters));
     }
     catch (SqlException)
     {
         throw;
     }
 }
Example #6
0
        /// <summary>
        /// 제품가격 변경하는 메서드
        /// </summary>
        /// <param name="ProNo">제품 번호</param>
        /// <param name="Price">변경할 가격</param>
        /// <returns>결과를 bool타입으로 반환</returns>
        internal bool PriceUpdate(int ProNo, int ChangPrice)
        {
            string sp = "Bom_JW_ProPriceChinge_Procedure";

            SqlParameter[] sqlParameters = new SqlParameter[2];
            sqlParameters[0] = new SqlParameter("@no", ProNo);
            sqlParameters[1] = new SqlParameter("@Price", ChangPrice);


            bool TrueFalse = false;

            try
            {
                if (dbp.ExecuteParameters(sp, sqlParameters) != -1)
                {
                    TrueFalse = true;
                }
            }
            catch (Exception)
            {
                return(false);
            }
            return(TrueFalse);
        }
Example #7
0
        public string DateInsert1()
        {
            int year  = 0;
            int month = 0;
            int day   = 0;


            DateTime dt;
            Random   rd = new Random();

            DBProcessor dbp             = new DBProcessor(ConfigurationManager.ConnectionStrings["conStr"].ConnectionString);
            int         cusno           = 0;
            int         empno           = 0;
            int         prono           = 0;
            int         cusorderorderno = 0;
            string      date            = null;
            int         price           = 0;
            int         ea = 0;

            string sp1 = "DataInsertProPrice";

            SqlParameter[] sqlParameter1 = new SqlParameter[1];
            string         sp2           = "DataInsert";

            SqlParameter[] sqlParameters2 = new SqlParameter[8];
            int            errorCheck     = 0;

            for (int i = 0; i < 50; i++) // >> 버튼 한번클릭마다 인트 i = 0 초기값을 올려줘야함
            {
                try
                {
                    errorCheck++;
                    price = 0;
                    prono = new Random().Next(24, 28);
                    ea    = new Random().Next(1, 4);
                    year  = rd.Next(2019, (int)DateTime.Today.Year + 1);
                    month = rd.Next(1, 3);
                    day   = rd.Next(1, 28);
                    date  = month.ToString() + "/" + day.ToString() + "/" + year.ToString();
                    dt    = DateTime.Parse(date);
                    /////////////////////////////////////////////////////////////////////////////
                    sqlParameter1[0] = new SqlParameter("@pro_No", prono);
                    //dbp.ExecuteParametersDT(sp1, sqlParameter1);
                    foreach (DataRow item in dbp.ExecuteParametersDT(sp1, sqlParameter1).Rows)
                    {
                        price = Int32.Parse(item["Pro_Price"].ToString()) * ea;
                    }
                    //////////////////////////////////////////////////////////////////////////////////
                    sqlParameters2[0] = new SqlParameter("@cus_No", 10);                      //5~9번 있음
                    sqlParameters2[1] = new SqlParameter("@emp_No", new Random().Next(1, 5)); //4명
                    sqlParameters2[2] = new SqlParameter("@pro_No", prono);                   //6개
                    sqlParameters2[3] = new SqlParameter("@cus_Order_OrderNo", i + 1047);     // >> 버튼 한번클릭마다 인트 i = 0 초기값을 올려줘야함
                    sqlParameters2[4] = new SqlParameter("@cus_Order_Date", dt);
                    sqlParameters2[5] = new SqlParameter("@cus_OrderComplete", 2);            //2번고정
                    sqlParameters2[6] = new SqlParameter("@cus_Order_Price", price);
                    sqlParameters2[7] = new SqlParameter("@cus_Order_EA", ea);
                    dbp.ExecuteParameters(sp2, sqlParameters2);
                }
                catch (Exception)
                {
                    return(errorCheck.ToString() + "번째에서 멈춤");
                }
            }
            return("완료");
        }