Example #1
0
        public ActionResult DCW003Paging(CmnPagingModel cmnPagingModel)
        {
            DCW003ConditionModel         conditionModel     = base.GetCache <DCW003ConditionModel>(CacheKeys.DCW003_CONDITION);
            List <DCW003FuzokuhinMaster> lstFuzokuhinMaster = new List <DCW003FuzokuhinMaster>();
            string typeMsg  = string.Empty;
            string errorMsg = string.Empty;
            int    rowCount = 0;

            conditionModel.PageIndex = cmnPagingModel.PageIndex;
            conditionModel.PageSize  = cmnPagingModel.PageSize;
            conditionModel.PageBegin = cmnPagingModel.PageBegin;
            conditionModel.PageEnd   = cmnPagingModel.PageEnd;

            DCW003DetailModel    detailModel  = new DCW003DetailModel();
            List <DCW003Result>  resultModel  = new List <DCW003Result>();
            List <DCW003Uketori> uketoriModel = new List <DCW003Uketori>();

            using (DCW003Services services = new DCW003Services())
            {
                lstFuzokuhinMaster         = services.DCW003GetFuzokuhinMaster();
                ViewBag.DocFuzokuhinMaster = lstFuzokuhinMaster;

                services.DCW003Search(conditionModel, lstFuzokuhinMaster, out resultModel, out uketoriModel, out rowCount);
            }

            detailModel.ResultModel  = resultModel;
            detailModel.UketoriModel = uketoriModel;
            base.SaveCache(CacheKeys.DCW003_CONDITION, conditionModel);
            InitialDropDownList();
            ViewBag.SearchCondition = conditionModel;
            return(View("_DCW003Result", detailModel));
        }
Example #2
0
        public ActionResult DCW003SendAutoSearch(List <DCW003Result> resultModel)
        {
            string lstError   = string.Empty;
            string lstSuccess = string.Empty;

            if (resultModel != null)
            {
                List <DCW003Update> lst = new List <DCW003Update>();

                foreach (var item in resultModel)
                {
                    lst.Add(new DCW003Update
                    {
                        RackNo    = item.RacNo,
                        FileNo    = item.FileNo,
                        ChassisNo = item.ChassisNo
                    });
                }

                using (DCW003Services services = new DCW003Services())
                {
                    services.DCW003SendAutoSearch(lst, out lstSuccess, out lstError);
                }

                return(ReturnListResult(SubStringList(lstSuccess), SubStringList(lstError)));
            }
            else
            {
                base.CmnEntityModel.ErrorMsgCd = "W0001";
                return(ReturnResult());
            }
        }
Example #3
0
 public ActionResult DCW003Register(List <DCW003Uketori> uketoriModel)
 {
     using (DCW003Services services = new DCW003Services())
     {
         services.DCW003Register(uketoriModel);
     }
     return(ReturnResult());
 }
Example #4
0
 public ActionResult DCW003Update(DCW003Result resultModel)
 {
     using (DCW003Services services = new DCW003Services())
     {
         services.DCW003Update(resultModel);
     }
     return(ReturnResult());
 }
Example #5
0
        public ActionResult DCW003UpdateAll(List <DCW003Result> resultModel)
        {
            //DCW003ConditionModel cache = base.GetCache<DCW003ConditionModel>(CacheKeys.DCW003_PAGING);
            //DCW003ConditionModel cache = base.GetCache<DCW003ConditionModel>(CacheKeys.DCW003_CONDITION);
            if (resultModel != null)
            {
                List <DCW003Update> lst = new List <DCW003Update>();
                //List<DCW003DropDownModel> dropDocStatus = new List<DCW003DropDownModel>();
                foreach (var item in resultModel)
                {
                    //item.PageIndex = cache.PageIndex;
                    //item.PageSize = cache.PageSize;
                    //item.PageBegin = cache.PageBegin;
                    //item.PageEnd = cache.PageEnd;
                    lst.Add(new DCW003Update
                    {
                        DocControlNo            = item.DocControlNo,
                        UriageShuppinTorokuNo   = item.UriageShuppinnTorokuNo,
                        MasshoFlg               = item.MasshoFlg,
                        JishameiFlg             = item.JishameiFlg,
                        DocStatus               = item.DocStatus,
                        DocNyukoDate            = item.DocNyukoDate,
                        DocShukkoDate           = item.DocShukkoDate,
                        JishameiIraiShukkoDate  = item.JishameiIraiShukkoDate,
                        JishameiKanryoNyukoDate = item.JishameiKanryoNyukoDate,
                        MasshoIraiShukkoDate    = item.MasshoIraiShukkoDate,
                        MasshoKanryoNyukoDate   = item.MasshoKanryoNyukoDate,
                        Memo = item.Memo
                    });
                }

                using (DCW003Services services = new DCW003Services())
                {
                    services.DCW003UpdateAll(lst);
                }
                //if (cache.ModeImport == 0)
                //{
                //    dropDocStatus.RemoveAt(0);
                //    ViewBag.DropDocStatus = dropDocStatus;
                //}
                //else
                //{
                //    ViewBag.DropDocStatus = dropDocStatus;
                //}
                //base.SaveCache(CacheKeys.DCW003_CONDITION,resultModel);
                return(ReturnResult());
            }
            else
            {
                base.CmnEntityModel.ErrorMsgCd = "W0001";
                return(ReturnResult());
            }
        }
Example #6
0
        public ActionResult DCW003Search(DCW003ConditionModel conditionModel)
        {
            List <DCW003FuzokuhinMaster> lstFuzokuhinMaster = new List <DCW003FuzokuhinMaster>();

            string typeMsg    = string.Empty;
            string contentMsg = string.Empty;
            int    rowCount   = 0;

            conditionModel.PageIndex = DCW003Constant.DEFAULT_PAGE_INDEX;
            conditionModel.PageSize  = DCW003Constant.DEFAULT_PAGE_SIZE;
            DCW003DetailModel    detailModel  = new DCW003DetailModel();
            List <DCW003Result>  resultModel  = new List <DCW003Result>();
            List <DCW003Uketori> uketoriModel = new List <DCW003Uketori>();

            using (DCW003Services services = new DCW003Services())
            {
                lstFuzokuhinMaster         = services.DCW003GetFuzokuhinMaster();
                ViewBag.DocFuzokuhinMaster = lstFuzokuhinMaster;

                services.DCW003Search(conditionModel, lstFuzokuhinMaster, out resultModel, out uketoriModel, out rowCount);
                if (resultModel.Count == 0)
                {
                    UtilityServices.Utility.GetMessage("I0003",
                                                       string.Empty,
                                                       out typeMsg,
                                                       out contentMsg);

                    this.ViewBag.typeMsgI0001    = typeMsg;
                    this.ViewBag.contentMsgI0001 = contentMsg;
                }
            }
            if (conditionModel == null)
            {
                conditionModel.PageIndex = DCW003Constant.DEFAULT_PAGE_INDEX;
                conditionModel.PageSize  = DCW003Constant.DEFAULT_PAGE_SIZE;
                conditionModel.TotalRow  = rowCount;
            }
            conditionModel.TotalRow = resultModel.Count != 0 ? resultModel[0].RowCount : 0;
            base.SaveCache(CacheKeys.DCW003_CONDITION, conditionModel);
            detailModel.ResultModel  = resultModel;
            detailModel.UketoriModel = uketoriModel;
            InitialDropDownList();
            ViewBag.SearchCondition = conditionModel;
            return(View("_DCW003Result", detailModel));
        }
Example #7
0
        private void InitialDropDownList()
        {
            List <DCW003DropDownModel> dropMassho    = new List <DCW003DropDownModel>();
            List <DCW003DropDownModel> dropJishamei  = new List <DCW003DropDownModel>();
            List <DCW003DropDownModel> dropDocStatus = new List <DCW003DropDownModel>();
            List <DCW003DropDownModel> dropYear      = new List <DCW003DropDownModel>();
            DCW003ConditionModel       cache         = base.GetCache <DCW003ConditionModel>(CacheKeys.DCW003_CONDITION);

            using (DCW003Services services = new DCW003Services())
            {
                dropDocStatus = services.DCW003GetMasterDocStatus();
                dropYear      = services.DCW003GetMasterYear();
            }
            //YEAR
            ViewBag.DropYear = dropYear;

            //DOC STATUS
            if (cache.ModeImport == 1 || cache.ModeImport == 2)
            {
                ViewBag.DropDocStatus = dropDocStatus;
            }
            else
            {
                dropDocStatus.RemoveAt(0);
                ViewBag.DropDocStatus = dropDocStatus;
            }
            //MASSHO
            dropMassho.Insert(0, new DCW003DropDownModel {
                Value = "0", Text = "継続"
            });
            dropMassho.Insert(1, new DCW003DropDownModel {
                Value = "1", Text = "抹消"
            });
            ViewBag.DropMassho = dropMassho;

            //JISHAMEI
            dropJishamei.Insert(0, new DCW003DropDownModel {
                Value = "0", Text = ""
            });
            dropJishamei.Insert(1, new DCW003DropDownModel {
                Value = "1", Text = "自社名済"
            });
            ViewBag.DropJishamei = dropJishamei;
        }
Example #8
0
        public ActionResult DCW003Index(int mode, int check)
        {
            string lstError        = string.Empty;
            string lstNoMap        = string.Empty;
            string lstImport       = string.Empty;
            string lstDocControlNo = string.Empty;
            string messageContent  = string.Empty;
            string messageType     = string.Empty;
            int    rowCount        = 0;

            DCW003Model          model          = new DCW003Model();
            DCW003ConditionModel conditionModel = new DCW003ConditionModel();
            DCW003DetailModel    detailModel    = new DCW003DetailModel();
            List <DCW003Uketori> uketoriModel   = new List <DCW003Uketori>();
            List <DCW003Result>  resultModel    = new List <DCW003Result>();
            DCW003ConditionModel cache          = base.GetCache <DCW003ConditionModel>(CacheKeys.DCW003_CONDITION);

            if (cache == null)
            {
                conditionModel.PageIndex   = DCW003Constant.DEFAULT_PAGE_INDEX;
                conditionModel.PageSize    = DCW003Constant.DEFAULT_PAGE_SIZE;
                conditionModel.KeiCarFlg0  = NUMBER.NUM_0;
                conditionModel.KeiCarFlg1  = NUMBER.NUM_0;
                conditionModel.JishameiFlg = NUMBER.NUM_0;
                conditionModel.MasshoFlg   = NUMBER.NUM_0;
                conditionModel.RadioType   = NUMBER.NUM_1;
            }
            else
            {
                conditionModel = cache;
                mode           = 0;
            }

            List <DCW003FuzokuhinMaster> lstFuzokuhinMaster = new List <DCW003FuzokuhinMaster>();

            using (DCW003Services services = new DCW003Services())
            {
                //Get label master fuzokuhin
                lstFuzokuhinMaster         = services.DCW003GetFuzokuhinMaster();
                ViewBag.DocFuzokuhinMaster = lstFuzokuhinMaster;

                switch (mode)
                {
                case 0:
                {
                    services.DCW003Search(conditionModel, lstFuzokuhinMaster, out resultModel, out uketoriModel, out rowCount);
                }
                break;

                //詳細条件で書類を検索する
                case 1:
                {
                    conditionModel.ShohinType           = DCW003Constant.SHOHIN_TYPE_DN;
                    conditionModel.DocStatus102         = 1;
                    conditionModel.AaDnSeiyakuDateStart = null;
                    conditionModel.AaDnSeiyakuDateEnd   = DateTime.Now.AddDays(-1);
                    ViewBag.Mode = 1;
                    services.DCW003Search(conditionModel, lstFuzokuhinMaster, out resultModel, out uketoriModel, out rowCount);
                }
                break;

                //本日発送予定の書類を検索する(普通車)
                case 2:
                {
                    conditionModel.ShohinType         = DCW003Constant.SHOHIN_TYPE_DN;
                    conditionModel.DocStatus102       = 1;
                    conditionModel.KeiCarFlg0         = NUMBER.NUM_1;
                    conditionModel.AaDnSeiyakuDateEnd = DateTime.Now.AddDays(-1);

                    services.DCW003Search(conditionModel, lstFuzokuhinMaster, out resultModel, out uketoriModel, out rowCount);
                }
                break;

                //本日発送予定の書類を検索する(軽)
                case 3:
                {
                    conditionModel.ShohinType         = DCW003Constant.SHOHIN_TYPE_DN;
                    conditionModel.DocStatus102       = 1;
                    conditionModel.KeiCarFlg1         = NUMBER.NUM_1;
                    conditionModel.AaDnSeiyakuDateEnd = DateTime.Now.AddDays(-1);

                    services.DCW003Search(conditionModel, lstFuzokuhinMaster, out resultModel, out uketoriModel, out rowCount);
                }
                break;

                //棚卸し
                case 5:
                {
                    conditionModel.DocStatus102 = 1;

                    services.DCW003Search(conditionModel, lstFuzokuhinMaster, out resultModel, out uketoriModel, out rowCount);
                }
                break;

                //Import 1
                case 6:
                {
                    List <DCW003CsvModel> lstCsv = new List <DCW003CsvModel>();
                    DataTable             tblCsv = (DataTable)TempData["tblCsv"];
                    if (tblCsv != null)
                    {
                        if (tblCsv.Rows.Count > 0)
                        {
                            for (int i = 0; i < tblCsv.Rows.Count; i++)
                            {
                                lstCsv.Add(new DCW003CsvModel
                                    {
                                        ID               = i,
                                        RacFileNo        = tblCsv.Rows[i][0].ToString(),
                                        KeiCarFlg        = tblCsv.Rows[i][1].ToString(),
                                        TorokuNo         = tblCsv.Rows[i][2].ToString(),
                                        HyobanType       = tblCsv.Rows[i][3].ToString(),
                                        ChassisNo        = tblCsv.Rows[i][4].ToString(),
                                        GendokiKatashiki = tblCsv.Rows[i][5].ToString(),
                                        ReportType       = tblCsv.Rows[i][6].ToString(),
                                    });
                            }
                            if (check == 0)
                            {
                                conditionModel.ModeImport = 1;
                                services.DCW003ImportCsv(lstCsv, out lstError, out lstNoMap, out lstImport, out lstDocControlNo);
                                Utility.GetMessage("I0010",
                                                   SubStringList(lstImport), SubStringList(lstError), SubStringList(lstNoMap),
                                                   out messageType,
                                                   out messageContent);
                                ViewBag.contentMsgI0010 = messageContent;
                                ViewBag.typeMsgI0010    = messageType;

                                if (!string.IsNullOrEmpty(lstDocControlNo))
                                {
                                    lstDocControlNo = lstDocControlNo.Substring(1);
                                    services.DCW003GetListImport(lstDocControlNo, lstFuzokuhinMaster, conditionModel.PageIndex, conditionModel.PageSize,
                                                                 out resultModel, out uketoriModel, out rowCount);
                                }
                            }
                            else
                            {
                                conditionModel.ModeImport = 2;
                                services.DCW003GetDocControlExist(lstCsv, lstFuzokuhinMaster, conditionModel.PageIndex, conditionModel.PageSize, 1,
                                                                  out resultModel, out uketoriModel, out lstImport, out rowCount);

                                Utility.GetMessage("I0010",
                                                   lstImport, string.Empty, string.Empty,
                                                   out messageType,
                                                   out messageContent);
                                ViewBag.contentMsgI0010 = messageContent;
                                ViewBag.typeMsgI0010    = messageType;
                            }
                        }
                        else
                        {
                            return(ReturnResult());
                        }
                    }
                }
                break;

                case 7:
                {
                    conditionModel.ModeImport = 3;
                    List <DCW003CsvModel> lstCsv = new List <DCW003CsvModel>();
                    DataTable             tblCsv = (DataTable)TempData["tblCsv"];
                    if (tblCsv != null)
                    {
                        if (tblCsv.Rows.Count > 0)
                        {
                            for (int i = 0; i < tblCsv.Rows.Count; i++)
                            {
                                lstCsv.Add(new DCW003CsvModel
                                    {
                                        ID               = i,
                                        KeiCarFlg        = tblCsv.Rows[i][0].ToString(),
                                        TorokuNo         = tblCsv.Rows[i][1].ToString(),
                                        HyobanType       = tblCsv.Rows[i][2].ToString(),
                                        ChassisNo        = tblCsv.Rows[i][3].ToString(),
                                        GendokiKatashiki = tblCsv.Rows[i][4].ToString(),
                                        ReportType       = tblCsv.Rows[i][5].ToString(),
                                    });
                            }

                            services.DCW003GetDocControlExist(lstCsv, lstFuzokuhinMaster, conditionModel.PageIndex, conditionModel.PageSize, 2,
                                                              out resultModel, out uketoriModel, out lstImport, out rowCount);
                        }
                    }
                }
                break;

                case 8:
                {
                    conditionModel.ModeImport = 3;
                    List <DCW003RFID> lstCsv = new List <DCW003RFID>();
                    DataTable         tblCsv = (DataTable)TempData["tblCsv"];
                    if (tblCsv != null)
                    {
                        if (tblCsv.Rows.Count > 0)
                        {
                            for (int i = 0; i < tblCsv.Rows.Count; i++)
                            {
                                lstCsv.Add(new DCW003RFID
                                    {
                                        ID      = i,
                                        RFIDKey = tblCsv.Rows[i][0].ToString(),
                                    });
                            }

                            resultModel = services.DCW003GetDocControlMaster(lstCsv, conditionModel.PageIndex, conditionModel.PageSize, out rowCount);
                        }
                    }
                }
                break;

                case 9:
                {
                    conditionModel.ModeImport = 4;
                    List <DCW003CsvModel> lstCsv = new List <DCW003CsvModel>();
                    DataTable             tblCsv = (DataTable)TempData["tblCsv"];
                    if (tblCsv != null)
                    {
                        if (tblCsv.Rows.Count > 0)
                        {
                            for (int i = 0; i < tblCsv.Rows.Count; i++)
                            {
                                if (tblCsv.Rows[i][5].ToString() == "自社名依頼")
                                {
                                    tblCsv.Rows[i][5] = "101";
                                }
                                else if (tblCsv.Rows[i][5].ToString() == "抹消依頼")
                                {
                                    tblCsv.Rows[i][5] = "201";
                                }
                                lstCsv.Add(new DCW003CsvModel
                                    {
                                        ID             = i,
                                        IraiDate       = tblCsv.Rows[i][0].ToString(),
                                        ShopCd         = tblCsv.Rows[i][1].ToString(),
                                        GenshaLocation = tblCsv.Rows[i][2].ToString(),
                                        CarName        = tblCsv.Rows[i][3].ToString(),
                                        ChassisNo      = tblCsv.Rows[i][4].ToString(),
                                        JMType         = tblCsv.Rows[i][5].ToString(),
                                        Note           = tblCsv.Rows[i][6].ToString(),
                                    });
                            }

                            services.DCW003GetDocControlExist(lstCsv, lstFuzokuhinMaster, conditionModel.PageIndex, conditionModel.PageSize, 3,
                                                              out resultModel, out uketoriModel, out lstImport, out rowCount);

                            if (resultModel.Count > 0)
                            {
                                services.DCWOO3InserJishameiMassho(resultModel, lstCsv);
                            }
                        }
                    }
                }
                break;
                }
            }

            conditionModel.TotalRow = resultModel.Count != 0 ? resultModel[0].RowCount: 0;
            if (conditionModel.TotalRow == 0 && mode != 6)
            {
                Utility.GetMessage(MessageCd.I0003, string.Empty, out messageType, out messageContent);
                ViewBag.typeMsgI0010    = messageType;
                ViewBag.contentMsgI0010 = messageContent;
            }
            detailModel.UketoriModel = uketoriModel;
            detailModel.ResultModel  = resultModel;
            model.Condition          = conditionModel;
            model.Detail             = detailModel;
            base.SaveCache(CacheKeys.DCW003_CONDITION, conditionModel);
            InitialDropDownList();

            ViewBag.SearchCondition = model.Condition;
            return(View(model));
        }