Esempio n. 1
0
        public string PostStorage(dynamic data)
        {
            string msg = "";

            var result = new APS_ProductPurchaseDetailService().AuditBillCode(data["mainID"].ToString(), out msg);

            return(msg);
        }
Esempio n. 2
0
        //todo 改成支持多个Tab
        // 地址:GET api/mms/@(controller)/getnewrowid 预取得新的明细表的行号
        public string GetNewRowId(string type, string key, int qty = 1)
        {
            switch (type)
            {
            case "grid0":
                var service0 = new APS_ProductPurchaseDetailService();
                return(service0.GetNewKey("ID", "maxplus", qty, ParamQuery.Instance().AndWhere("ID", key, Cp.Equal)));

            default:
                return("");
            }
        }
Esempio n. 3
0
        public string PostSetType(dynamic data)
        {
            string msg = "";
            string ids = data["ids"].ToString();

            ids = ids.Remove(ids.Length - 2, 1);
            if (data["UserCode"] == null || data["SaleMan"] == null)
            {
                msg = "请选择采购员";
            }
            var result = new APS_ProductPurchaseDetailService().SetType(ids, data["UserCode"].ToString(), data["SaleMan"].ToString(), out msg);

            return(msg);
        }
Esempio n. 4
0
     public void Edit(dynamic data)
     {
         var listWrapper = RequestWrapper.Instance().LoadSettingXmlString(@"
 <settings>
     <table>
         APS_ProductPurchaseDetail
     </table>
     <where>
         <field name='ID' cp='equal'></field>
     </where>
 </settings>");
         var service     = new APS_ProductPurchaseDetailService();
         var result      = service.Edit(null, listWrapper, data);
     }
Esempio n. 5
0
        public dynamic Get(RequestWrapper query)
        {
            query.LoadSettingXmlString(@"
    <settings defaultOrderBy='ID'>
        <select>*</select>
        <from>V_ProductPurchaseDetailAndMain</from>
        <where defaultForAll='true' defaultCp='equal' defaultIgnoreEmpty='true'>
                <field name='ContractCode'       cp='equal'></field>
                <field name='WarehouseName'          cp='like'></field>
                <field name='PurchaseDate'       cp='equal'></field>
                <field name='UserCode'       cp='equal'></field>
        </where>
    </settings>");
            var service = new APS_ProductPurchaseDetailService();
            var pQuery  = query.ToParamQuery();
            var result  = service.GetDynamicListWithPaging(pQuery);

            return(result);
        }
Esempio n. 6
0
        public string GetDelete(string id)
        {
            string msg    = "删除成功!";
            var    pQuery = ParamQuery.Instance().Select("*").AndWhere("ID", id);
            var    re     = new APS_ProductPurchaseMainService().GetModel(pQuery);

            if (re == null || re.BillState == 2)
            {
                msg = "已审核不能删除!";
            }
            else
            {
                var result   = new APS_ProductPurchaseMainService().GetDelete(id);
                var pQuery2  = ParamQuery.Instance().Select("*").AndWhere("MainID", id);
                var services = new APS_ProductPurchaseDetailService();
                var list     = services.GetModelList(pQuery2);
                foreach (var item in list)
                {
                    services.GetDelete(item.ID.ToString());
                }
            }

            return(msg);
        }