예제 #1
0
        public P_MARKET_INVOICE_OBJ GetAllMarkets()
        {
            var markets = bizConfigDao.GetAllMarkets();
            P_MARKET_INVOICE_OBJ obj = new P_MARKET_INVOICE_OBJ();

            if (markets.Count > 0)
            {
                foreach (var _v in markets)
                {
                    switch (_v.Name)
                    {
                    case "Rx":
                        obj.Rx = _v.InvoiceTitle;
                        obj.RxDutyParagraph = _v.DutyParagraph;
                        break;

                    case "Vx":
                        obj.Vx = _v.InvoiceTitle;
                        obj.VxDutyParagraph = _v.DutyParagraph;
                        break;

                    case "TSKF":
                        obj.TSKF = _v.InvoiceTitle;
                        obj.TSKFDutyParagraph = _v.DutyParagraph;
                        break;

                    case "DDT":
                        obj.DDT = _v.InvoiceTitle;
                        obj.DDTDutyParagraph = _v.DutyParagraph;
                        break;

                    case "R&D":
                        obj.RD = _v.InvoiceTitle;
                        obj.RDDutyParagraph = _v.DutyParagraph;
                        break;

                    default:
                        break;
                    }
                }
            }
            else
            {
                obj.Rx = string.Empty;
                obj.RxDutyParagraph = string.Empty;
                obj.Vx = string.Empty;
                obj.VxDutyParagraph   = string.Empty;
                obj.TSKF              = string.Empty;
                obj.TSKFDutyParagraph = string.Empty;
                obj.DDT = string.Empty;
                obj.DDTDutyParagraph = string.Empty;
                obj.RD = string.Empty;
                obj.RDDutyParagraph = string.Empty;
            }
            return(obj);
        }
예제 #2
0
        //[AdminSessionFilter(Order = 1)]
        //[PermissionFilter(Order = 2, Permission = "00000000-0000-0000-4000-000000000001")]
        public JsonResult SaveInvoiceData(P_MARKET_INVOICE_OBJ Data)
        {
            List <P_MARKET> unSuccessData;
            var             updCnt = bizConfigService.UpdateMarketsInvoice(Data, out unSuccessData);

            if (unSuccessData.Count == 0 && updCnt > 0)
            {
                return(Json(new { state = 1 }));
            }
            else
            {
                string _txt;
                if (updCnt == 0)
                {
                    _txt = "保存失败!";
                }
                else
                {
                    _txt = "部分保存失败!" + JsonConvert.SerializeObject(unSuccessData);
                }

                return(Json(new { state = 0, txt = _txt }));
            }
        }
예제 #3
0
        public int UpdateMarketsInvoice(P_MARKET_INVOICE_OBJ entity, out List <P_MARKET> unSuccessData)
        {
            int updCnt = 0;

            if (entity != null)
            {
                List <P_MARKET> saveList = new List <P_MARKET>();
                P_MARKET        _market  = new P_MARKET()
                {
                    Name = "Rx", InvoiceTitle = entity.Rx, DutyParagraph = entity.RxDutyParagraph
                };
                saveList.Add(_market);
                _market = new P_MARKET()
                {
                    Name = "Vx", InvoiceTitle = entity.Vx, DutyParagraph = entity.VxDutyParagraph
                };
                saveList.Add(_market);
                _market = new P_MARKET()
                {
                    Name = "TSKF", InvoiceTitle = entity.TSKF, DutyParagraph = entity.TSKFDutyParagraph
                };
                saveList.Add(_market);
                _market = new P_MARKET()
                {
                    Name = "DDT", InvoiceTitle = entity.DDT, DutyParagraph = entity.DDTDutyParagraph
                };
                saveList.Add(_market);
                _market = new P_MARKET()
                {
                    Name = "RD", InvoiceTitle = entity.RD, DutyParagraph = entity.RDDutyParagraph
                };
                saveList.Add(_market);
                updCnt = bizConfigDao.UpdateMarkets(saveList, out unSuccessData);
            }
            else
            {
                unSuccessData = new List <P_MARKET>();
                P_MARKET _market = new P_MARKET()
                {
                    Name = "Rx", InvoiceTitle = string.Empty
                };
                unSuccessData.Add(_market);
                _market = new P_MARKET()
                {
                    Name = "Vx", InvoiceTitle = string.Empty
                };
                unSuccessData.Add(_market);
                _market = new P_MARKET()
                {
                    Name = "TSKF", InvoiceTitle = string.Empty
                };
                unSuccessData.Add(_market);
                _market = new P_MARKET()
                {
                    Name = "DDT", InvoiceTitle = string.Empty
                };
                unSuccessData.Add(_market);
                _market = new P_MARKET()
                {
                    Name = "RD", InvoiceTitle = string.Empty
                };
                unSuccessData.Add(_market);
            }
            return(updCnt);
        }