Example #1
0
        public DataTable IdouNyuuryoku_Display(IdouNyuuryokuEntity obj)
        {
            CKMDL ckmdl      = new CKMDL();
            var   parameters = new SqlParameter[11];

            parameters[0] = new SqlParameter("@BrandCD", SqlDbType.VarChar)
            {
                Value = obj.BrandCD
            };
            parameters[1] = new SqlParameter("@ShouhinCD", SqlDbType.VarChar)
            {
                Value = obj.ShouhinCD
            };
            parameters[2] = new SqlParameter("@ShouhinName", SqlDbType.VarChar)
            {
                Value = obj.ShouhinName
            };
            parameters[3] = new SqlParameter("@JANCD", SqlDbType.VarChar)
            {
                Value = obj.JANCD
            };
            parameters[4] = new SqlParameter("@YearTerm", SqlDbType.VarChar)
            {
                Value = obj.YearTerm
            };
            parameters[5] = new SqlParameter("@SeasonSS", SqlDbType.VarChar)
            {
                Value = obj.SeasonSS
            };
            parameters[6] = new SqlParameter("@SeasonFW", SqlDbType.VarChar)
            {
                Value = obj.SeasonFW
            };
            parameters[7] = new SqlParameter("@ColorNo", SqlDbType.VarChar)
            {
                Value = obj.ColorNO
            };
            parameters[8] = new SqlParameter("@SizeNo", SqlDbType.VarChar)
            {
                Value = obj.SizeNO
            };
            parameters[9] = new SqlParameter("@ChangeDate", SqlDbType.VarChar)
            {
                Value = obj.ChangeDate
            };
            parameters[10] = new SqlParameter("@SoukoCD", SqlDbType.VarChar)
            {
                Value = obj.SoukoCD
            };
            DataTable dt = ckmdl.SelectDatatable("IdouNyuuryoku_Display", GetConnectionString(), parameters);

            return(dt);
        }
Example #2
0
        public DataTable IdouNyuuryo_Search(IdouNyuuryokuEntity obj)
        {
            CKMDL ckmdl      = new CKMDL();
            var   parameters = new SqlParameter[10];

            parameters[0] = new SqlParameter("@Date1", SqlDbType.VarChar)
            {
                Value = obj.Date1
            };
            parameters[1] = new SqlParameter("@Date2", SqlDbType.VarChar)
            {
                Value = obj.Date2
            };
            parameters[2] = new SqlParameter("@ShukkoSoukoCD", SqlDbType.VarChar)
            {
                Value = obj.ShukkoSoukoCD
            };
            parameters[3] = new SqlParameter("@NyuukoSoukoCD", SqlDbType.VarChar)
            {
                Value = obj.NyuukoSoukoCD
            };
            parameters[4] = new SqlParameter("@ShouhinName", SqlDbType.VarChar)
            {
                Value = obj.ShouhinName
            };
            parameters[5] = new SqlParameter("@IdouNO1", SqlDbType.VarChar)
            {
                Value = obj.IdouNO1
            };
            parameters[6] = new SqlParameter("@IdouNO2", SqlDbType.VarChar)
            {
                Value = obj.IdouNO2
            };
            parameters[7] = new SqlParameter("@StaffCD", SqlDbType.VarChar)
            {
                Value = obj.StaffCD
            };
            parameters[8] = new SqlParameter("@ShouhinCD1", SqlDbType.VarChar)
            {
                Value = obj.ShouhinCD1
            };
            parameters[9] = new SqlParameter("@ShouhinCD2", SqlDbType.VarChar)
            {
                Value = obj.ShouhinCD2
            };
            DataTable dt = ckmdl.SelectDatatable("IdouNyuuryo_Search", GetConnectionString(), parameters);

            return(dt);
        }
        private void DataGridviewBind()
        {
            IdouNyuuryokuEntity obj = new IdouNyuuryokuEntity();

            if (cf.DateCheck(txtDate1))           //Task no. 147 - tza
            {
                obj.Date1 = txtDate1.Text;
            }
            if (cf.DateCheck(txtDate2))           //Task no. 147 - tza
            {
                obj.Date2 = txtDate2.Text;
            }

            obj.ShukkoSoukoCD = txtShukkosouko.Text;
            obj.NyuukoSoukoCD = txtNyukosouko.Text;
            obj.ShouhinName   = txtShouhinName.Text;

            obj.IdouNO1    = txtNo11.Text;
            obj.IdouNO2    = txtNo12.Text;
            obj.StaffCD    = txtStaffCD.Text;
            obj.ShouhinCD1 = txtShouhin1.Text;
            obj.ShouhinCD2 = txtShouhin2.Text;

            if (ErrorCheck(panel1))           //Task no. 147 - tza
            {
                IdouNyuuryokuBL objMethod = new IdouNyuuryokuBL();
                DataTable       dt        = objMethod.IdouNyuuryo_Search(obj);
                if (dt.Columns.Contains("CurrentDate"))
                {
                    if (dt.Rows.Count > 0)
                    {
                        lbl_Date.Text       = String.Format("{0:yyyy/MM/dd}", dt.Rows[0]["CurrentDate"]);
                        txtCurrentDate.Text = String.Format("{0:yyyy/MM/dd}", dt.Rows[0]["CurrentDate"]);
                    }
                    else
                    {
                        ClearSession();
                    }
                }
                gv_Idou.DataSource = dt;
            }
        }
        private void F10_Gridview_Bind()
        {
            gv_1.ActionType = "F10";
            if (ErrorCheck(PanelDetail))
            {
                IdouNyuuryokuEntity obj = new IdouNyuuryokuEntity();
                obj.BrandCD     = txtBrandCD.Text;
                obj.ShouhinCD   = txtShouhinCD.Text;
                obj.JANCD       = txtJANCD.Text;
                obj.ShouhinName = txtShouhinName.Text;
                obj.YearTerm    = txtYearTerm.Text;
                obj.SeasonSS    = chk_SS.Checked ? "1" : "0";
                obj.SeasonFW    = chk_FW.Checked ? "1" : "0";
                obj.ColorNO     = txtColorNo.Text;
                obj.SizeNO      = txtSizeNo.Text;

                if (string.IsNullOrEmpty(obj.BrandCD) && string.IsNullOrEmpty(obj.ShouhinCD) && string.IsNullOrEmpty(obj.JANCD) && string.IsNullOrEmpty(obj.ShouhinName) && string.IsNullOrEmpty(obj.YearTerm) && obj.SeasonSS == "0" && obj.SeasonFW == "0" && string.IsNullOrEmpty(obj.SizeNO) && string.IsNullOrEmpty(obj.ColorNO))
                {
                    base_bl.ShowMessage("E111");
                    txtBrandCD.Focus();
                    return;
                }

                obj.ChangeDate = txtIdouDate.Text;
                if (txtIdoukubun.Text == "1")
                {
                    obj.SoukoCD = txtNyukosouko.Text;
                }
                else
                {
                    obj.SoukoCD = txtShukkosouko.Text;
                }
                DataTable dt = Idou_BL.IdouNyuuryoku_Display(obj);
                if (dt.Rows.Count > 0)
                {
                    if (F8_dt1.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            //重複行はDelete
                            string  ShouhinCD = dr["ShouhinCD"].ToString();
                            DataRow existDr1  = F8_dt1.Select("ShouhinCD ='" + ShouhinCD + "'").SingleOrDefault();
                            if (existDr1 != null)
                            {
                                dr["IdouGyouNO"] = "99";    //未使用項目のため
                            }
                        }
                    }
                    DataRow[] select_dr1 = dt.Select("IdouGyouNO = '99'");
                    foreach (DataRow dr in select_dr1)
                    {
                        dt.Rows.Remove(dr);
                    }

                    gv_1.DataSource = dt;
                    gv_1.Focus();
                    DataTable dt_temp = dt.Copy();
                    gv1_to_dt1 = dt_temp;

                    if (F8_dt1.Rows.Count == 0)
                    {
                        F8_dt1 = gv1_to_dt1.Clone();
                    }
                    gv_1.Select();
                    if (dt.Rows.Count > 0)
                    {
                        gv_1.CurrentCell = gv_1.Rows[0].Cells["colKanriNO"];
                    }
                }
                else
                {
                    //F8_dt1.Rows.Clear();
                    //gv_1.DataSource = F8_dt1;
                    gv_1.DataSource = dt;
                    Focus_Clear();
                }
            }
            gv_1.ActionType = string.Empty;
        }