示例#1
0
        public bool MakerZaiko_Delete(M_MakerZaiko_H_Entity makerH_data, MakerZaiko_D_Entity makerD_data, M_NoukiHenkan_Entity nouki_data, L_Log_Entity l_log, SuuryoHenKan_Entity suuryo_data)
        {
            hdl.StartTransaction();

            makerD_data.KamokuXML = DataTableToXml(makerD_data.dtKamoKu);
            nouki_data.NoukiXML   = DataTableToXml(nouki_data.dtNouki);

            if (hdl.M_MakerZaiko_H_Delete(makerH_data))
            {
                ddl.Transaction = hdl.Transaction;
                if (ddl.M_MakerZaiko_D_Delete(makerD_data))
                {
                    if (ndl.M_NoukiHenkan_Delete(nouki_data))
                    {
                        sydl.Transaction = hdl.Transaction;
                        if (sydl.SuuryoHenKan_Delete(suuryo_data))
                        {
                            LogDL.Transaction = hdl.Transaction;
                            if (LogDL.L_Log_Insert(l_log))
                            {
                                hdl.CommitTransaction();
                                return(true);
                            }
                        }
                    }
                }
            }
            return(false);
        }
示例#2
0
        public bool M_MakerZaiko_H_Delete(M_MakerZaiko_H_Entity maker_H_data)
        {
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("@PatternCD", maker_H_data.PatternCD);
            return(InsertUpdateDeleteData(dic, "MakerZaiko_H_Delete"));
        }
        private M_MakerZaiko_H_Entity GetMakerH_Entity()
        {
            makerH_entity             = new M_MakerZaiko_H_Entity();
            makerH_entity.KAICD       = loginInfo.CompanyCode;
            makerH_entity.PatternCD   = ucPattern.UC_Code;;
            makerH_entity.PatternName = txtPatternName.Text;

            return(makerH_entity);
        }
示例#4
0
        public DataTable M_MakerZaiko_H_Select(M_MakerZaiko_H_Entity maker_H_data) //Pattern_List_BL
        {
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("@PatternCD", maker_H_data.PatternCD);
            dic.Add("@PatternName", maker_H_data.PatternName);

            return(SelectData(dic, "M_MakerZaiko_H_Select"));
        }
示例#5
0
        /// <summary>
        /// Bind Data to DataGridView
        /// </summary>
        private void BindGrid()
        {
            maker_H_Data             = new M_MakerZaiko_H_Entity();
            maker_H_Data.PatternName = txtPatternName.Text;
            DataTable dt_MZKH = new DataTable();

            dt_MZKH            = Pattern_BL.M_MakerZaiko_H_Select(maker_H_Data);
            dgvMKZH.DataSource = dt_MZKH;
            if (dt_MZKH.Rows.Count > 0)
            {
                dgvMKZH.Rows[0].Selected = true;
            }
        }
示例#6
0
        public bool M_MakerZaiko_H_Update(M_MakerZaiko_H_Entity maker_H_data)
        {
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("@PatternCD", maker_H_data.PatternCD);
            dic.Add("@PatternName", maker_H_data.PatternName);
            dic.Add("@InsertOperator", maker_H_data.InsertOperator);
            dic.Add("@InsertDateTime", maker_H_data.InsertDateTime);
            dic.Add("@UpdateOperator", maker_H_data.InsertOperator);
            dic.Add("@UpdateDateTime", maker_H_data.InsertDateTime);


            return(InsertUpdateDeleteData(dic, "M_MakerZaiko_H_Update"));
        }
        private void PatternCD_Validating(object sender, CancelEventArgs e)
        {
            TextBox txt = sender as TextBox;
            int     row = dgvM_MakerZaiko.CurrentCell.RowIndex;

            if (string.IsNullOrWhiteSpace(txt.Text))
            {
                dgvM_MakerZaiko.Rows[row].Cells["colPatternName"].Value = string.Empty;

                return;
            }

            mzhe           = new M_MakerZaiko_H_Entity();
            mzhe.PatternCD = txt.Text;
            DataTable dt = psks0102mbl.M_MakerZaiko_H_Select(mzhe);

            if (dt.Rows.Count > 0)
            {
                dgvM_MakerZaiko.Rows[row].Cells["colPatternName"].Value = dt.Rows[0]["PatternName"].ToString();

                if (!string.IsNullOrWhiteSpace(ucMaker.UC_Code))
                {
                    dgvM_MakerZaiko.Rows[row].Cells[dgvM_MakerZaiko.Columns["colMakerCD"].Index].Value   = ucMaker.UC_Code;
                    dgvM_MakerZaiko.Rows[row].Cells[dgvM_MakerZaiko.Columns["colMakerName"].Index].Value = ucMaker.UC_Name;
                }

                if (!string.IsNullOrWhiteSpace(ucBrand.UC_Code))
                {
                    dgvM_MakerZaiko.Rows[row].Cells[dgvM_MakerZaiko.Columns["colBrandCD"].Index].Value   = ucBrand.UC_Code;
                    dgvM_MakerZaiko.Rows[row].Cells[dgvM_MakerZaiko.Columns["colBrandName"].Index].Value = ucBrand.UC_Name;
                }

                CheckRowAdd(dgvM_MakerZaiko.Rows[row]);
            }
            else
            {
                DSP_MSG("E101", string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);
                dgvM_MakerZaiko.Rows[row].Cells["colPatternName"].Value = string.Empty;
                dgvM_MakerZaiko.CurrentCell = dgvM_MakerZaiko[dgvM_MakerZaiko.Columns["colPatternCD"].Index, row];
                if (lastKeyIsEnter)
                {
                    SendKeys.Send("+{TAB}");
                }
                else
                {
                    e.Cancel = true;
                }
            }
        }
示例#8
0
        public bool MakerZaiko_Insert(M_MakerZaiko_H_Entity makerH_data, MakerZaiko_D_Entity makerD_data, M_NoukiHenkan_Entity nouki_data, L_Log_Entity l_log, SuuryoHenKan_Entity suuryo_data)
        {
            hdl.StartTransaction();
            DataRow[] dtrowMaker  = makerD_data.dtKamoKu.Select("ItemName IS NOT NULL OR ItemName <> ' '");
            DataRow[] dtrowNouki  = nouki_data.dtNouki.Select("Maker IS NOT NULL OR Maker <> ' '");
            DataRow[] dtrowSuuryo = suuryo_data.dtSuuryo.Select("MakerSuuryo IS NOT NULL OR MakerSuuryo <> ' '");

            if (dtrowMaker.Count() > 0)
            {
                DataTable dtMaker = makerD_data.dtKamoKu.Select("ItemName IS NOT NULL OR ItemName <> ' '").CopyToDataTable();
                makerD_data.KamokuXML = DataTableToXml(dtMaker);
            }
            if (dtrowNouki.Count() > 0)
            {
                DataTable dtNouki = nouki_data.dtNouki.Select("Maker IS NOT NULL OR Maker <> ' '").CopyToDataTable();
                nouki_data.NoukiXML = DataTableToXml(dtNouki);
            }

            if (dtrowSuuryo.Count() > 0)
            {
                DataTable dtSuuryo = suuryo_data.dtSuuryo.Select("MakerSuuryo IS NOT NULL OR MakerSuuryo <> ' '").CopyToDataTable();
                suuryo_data.SuuryoXML = DataTableToXml(dtSuuryo);
            }

            if (hdl.M_MakerZaiko_H_Update(makerH_data))
            {
                ddl.Transaction = hdl.Transaction;
                if (ddl.M_MakerZaiko_D_Insert(makerD_data))
                {
                    ndl.Transaction = hdl.Transaction;
                    if (ndl.M_NoukiHenkan_Insert(nouki_data))
                    {
                        sydl.Transaction = hdl.Transaction;
                        if (sydl.SuuryoHenKan_Insert(suuryo_data))
                        {
                            LogDL.Transaction = hdl.Transaction;
                            if (LogDL.L_Log_Insert(l_log))
                            {
                                hdl.CommitTransaction();
                                return(true);
                            }
                        }
                    }
                }
            }

            return(false);
        }
        private bool ExecutionProcess()
        {
            makerH_entity             = GetMakerH_Entity();
            makerD_entity             = GetMakerD_Entity();
            nouki_entity              = GetNouki_Entity();
            suuryo_entity             = GetSuuryo_Entity();
            LLogEntity                = new L_Log_Entity();
            LLogEntity.InsertOperator = loginInfo.OperatorCode;
            string dateandTime = DateTime.Now.ToString();

            LLogEntity.OperateDate       = makerH_entity.InsertDateTime = nouki_entity.InsertDateTime = suuryo_entity.InsertDateTime = dateandTime;
            LLogEntity.Program           = "PSKS0101M";
            LLogEntity.PC                = loginInfo.PcName;
            LLogEntity.OperateMode       = FormMode;
            LLogEntity.KeyItem           = ucPattern.UC_Code;
            makerH_entity.InsertOperator = loginInfo.OperatorCode;
            nouki_entity.InsertOperator  = loginInfo.OperatorCode;
            suuryo_entity.InsertOperator = loginInfo.OperatorCode;
            bool result = false;

            switch (FormMode)
            {
            case "新規":
                result = sks0101M_bl.MakerZaiko_Insert(makerH_entity, makerD_entity, nouki_entity, LLogEntity, suuryo_entity);
                break;

            case "修正":
                makerH_entity.UpdateOperator = loginInfo.OperatorCode;
                nouki_entity.UpdateOperator  = loginInfo.OperatorCode;
                suuryo_entity.UpdateOperator = loginInfo.OperatorCode;
                makerH_entity.UpdateDateTime = nouki_entity.UpdateDateTime = suuryo_entity.UpdateDateTime = dateandTime;
                result = sks0101M_bl.MakerZaiko_Update(makerH_entity, makerD_entity, nouki_entity, LLogEntity, suuryo_entity);
                break;

            case "削除":
                result = sks0101M_bl.MakerZaiko_Delete(makerH_entity, makerD_entity, nouki_entity, LLogEntity, suuryo_entity);
                break;
            }
            return(result);
        }
        private void SetMaker_Data(string comCode)

        {
            MakerZaiko_D_Entity   maker_D_data = new MakerZaiko_D_Entity();
            M_NoukiHenkan_Entity  nouki_data   = new M_NoukiHenkan_Entity();
            M_MakerZaiko_H_Entity maker_H_data = new M_MakerZaiko_H_Entity();
            SuuryoHenKan_Entity   suuryo_data  = new SuuryoHenKan_Entity();
            PSKS0101M_BL          sks0101m_bl  = new PSKS0101M_BL();
            DataTable             dtmakerD     = new DataTable();
            DataTable             dtnoukidata  = new DataTable();
            DataTable             dtsuuryodata = new DataTable();

            if (!FormMode.Equals("新規"))
            {
                txtPatternName.Text = ucPattern.UC_Name;
            }

            maker_D_data.PatternCD = comCode;
            nouki_data.PatternCD   = comCode;
            maker_H_data.PatternCD = comCode;
            suuryo_data.PatternCD  = comCode;

            dtmakerD     = sks0101m_bl.MakerZaiko_Select(maker_D_data);
            dtnoukidata  = sks0101m_bl.Nouki_Select(nouki_data);
            dtsuuryodata = sks0101m_bl.Suuryo_Select(suuryo_data);

            for (int i = 1; i <= 300; i++)
            {
                DataRow[] drs = dtnoukidata.Select("SEQ = '" + i + "'");
                if (drs.Count() <= 0)
                {
                    DataRow dr = dtnoukidata.NewRow();
                    dr["SEQ"] = i.ToString();

                    dtnoukidata.Rows.Add(dr);

                    DataView dv = dtnoukidata.DefaultView;
                    dv.Sort = "SEQ ASC";
                    dtNouki = dv.ToTable();
                }
            }
            dtNouki = dtnoukidata;
            dgvdelivery.DataSource = dtNouki;


            for (int i = 1; i <= 300; i++)
            {
                DataRow[] drs = dtmakerD.Select("SEQ = '" + i + "'");
                if (drs.Count() <= 0)
                {
                    DataRow dr = dtmakerD.NewRow();
                    dr["SEQ"] = i.ToString();

                    dtmakerD.Rows.Add(dr);

                    DataView dv = dtmakerD.DefaultView;
                    dv.Sort  = "SEQ ASC";
                    dtmakerD = dv.ToTable();
                }
            }
            dtKaMoku             = dtmakerD;
            dgvKamoku.DataSource = dtKaMoku;

            for (int i = 1; i <= 300; i++)
            {
                DataRow[] drs = dtsuuryodata.Select("SEQ= '" + i + "'");
                if (drs.Count() <= 0)
                {
                    DataRow dr = dtsuuryodata.NewRow();
                    dr["SEQ"] = i.ToString();
                    dtsuuryodata.Rows.Add(dr);
                    DataView dv = dtsuuryodata.DefaultView;
                    dv.Sort      = "SEQ ASC ";
                    dtsuuryodata = dv.ToTable();
                }
            }
            dtSuuryo = dtsuuryodata;
            dgvSuuryoHenKan.DataSource = dtsuuryodata;

            ucPattern.SetFocus();
        }
示例#11
0
 public DataTable M_MakerZaiko_H_Select(M_MakerZaiko_H_Entity mhe) //Pattern_List_BL
 {
     return(makerzaikohDL.M_MakerZaiko_H_Select(mhe));
 }
 public DataTable M_MakerZaiko_H_Select(M_MakerZaiko_H_Entity maker_H_data)
 {
     return(maker_H_DL.M_MakerZaiko_H_Select(maker_H_data));
 }