Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string id = Request.QueryString["id"];
            long   serId;

            if (string.IsNullOrEmpty(id) || !long.TryParse(id, out serId))
            {
                Response.Close();
                return;
            }
            service = bll.GetService(serId);
            if (service.object_type == 1)
            {
                var ser = new ServiceBLL().GetServiceById(service.object_id);
                serviceName = ser.name;
                description = ser.invoice_description;
            }
            else
            {
                var ser = new ServiceBLL().GetServiceBundleById(service.object_id);
                serviceName = ser.name;
                description = ser.invoice_description;
            }

            if (IsPostBack)
            {
                var ser = AssembleModel <ctt_contract_service>();
                bll.EditServiceInvoiceDescription(ser, GetLoginUserId());
                Response.Write("<script>alert('修改发票描述成功!');window.close();self.opener.location.reload();</script>");
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string cId = Request.QueryString["id"];
                serviceId = long.Parse(cId);
            }
            else
            {
                serviceId = long.Parse(Request.Form["serId"]);
            }
            service  = bll.GetService(serviceId);
            contract = new ContractBLL().GetContract(service.contract_id);
            DTO.DicEnum.QUOTE_ITEM_PERIOD_TYPE svcPeriod, maxPeriod;
            decimal rate = bll.GetPeriodRate((DTO.DicEnum.QUOTE_ITEM_PERIOD_TYPE)contract.period_type, service.id, 0, out svcPeriod, out maxPeriod);

            if (rate > 1)
            {
                service.unit_cost  = service.unit_cost / rate;
                service.unit_price = service.unit_price / rate;
            }
            if (service.object_type == 1)
            {
                serviceTypeName = "服务";
            }
            else if (service.object_type == 2)
            {
                serviceTypeName = "服务包";
            }
            serviceName = bll.GetServiceName(service);

            if (IsPostBack)
            {
                ctt_contract_service ser = new ctt_contract_service();
                ser.id = serviceId;
                try
                {
                    ser.quantity       = int.Parse(Request.Form["serUnits"]);
                    ser.unit_price     = decimal.Parse(Request.Form["serPrice"]);
                    ser.unit_cost      = decimal.Parse(Request.Form["serCost"]);
                    ser.adjusted_price = int.Parse(Request.Form["serAdjustCost"]);
                    ser.effective_date = DateTime.Parse(Request.Form["effective_date"]);
                }
                catch
                {
                    Response.Write("<script>alert('输入有误,调整失败!');</script>");
                    return;
                }
                if (service.object_type == 1)
                {
                    new ContractServiceBLL().AdjustService(ser, GetLoginUserId());
                }
                else if (service.object_type == 2)
                {
                    new ContractServiceBLL().AdjustServiceBundle(ser, GetLoginUserId());
                }
                Response.Write("<script>alert('调整成功!');window.close();self.opener.location.reload();</script>");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            var contratId = Request.QueryString["contractId"];
            var seviceId  = Request.QueryString["serviceId"];
            var insProId  = Request.QueryString["insProId"];

            if (!string.IsNullOrEmpty(contratId))
            {
                contract = new ContractBLL().GetContract(long.Parse(contratId));
            }
            if (!string.IsNullOrEmpty(insProId))
            {
                insPro = new crm_installed_product_dal().FindNoDeleteById(long.Parse(insProId));
            }
            if (!string.IsNullOrEmpty(seviceId))
            {
                contractService = new ctt_contract_service_dal().FindNoDeleteById(long.Parse(seviceId));
            }
            if (contractService == null || contract == null || insPro == null)
            {
                Response.Write("<script>alert('未获取到相关配置项,合同信息');window.close();</script>");
                return;
            }
        }