protected void save_click_Click(object sender, EventArgs e) { var result = ERROR_CODE.SUCCESS; if (isAdd) { result = new InstalledProductBLL().SubscriptiomInsert(GetParam(), GetLoginUserId()); } else { result = new InstalledProductBLL().SubscriptiomEdit(GetParam(), GetLoginUserId()); } switch (result) { case ERROR_CODE.SUCCESS: ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('保存成功!');window.close();self.opener.location.reload();</script>"); break; case ERROR_CODE.PARAMS_ERROR: ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('必填参数丢失,请重新填写');</script>"); break; case ERROR_CODE.USER_NOT_FIND: Response.Write("<script>alert('未找到用户,请重新登陆');</script>"); Response.Redirect("../Login.aspx"); break; default: break; } }
/// <summary> /// 配置项是否需要合同审核 /// </summary> private void ReviewInsPro(HttpContext context) { var insProId = context.Request.QueryString["insProId"]; // 需要变更的ID 的集合 var isView = !string.IsNullOrEmpty(context.Request.QueryString["isView"]); bool result = false; if (!string.IsNullOrEmpty(insProId)) { result = new InstalledProductBLL().ReviewInsPro(insProId, isView, LoginUserId); } context.Response.Write(new Tools.Serialize().SerializeJson(result)); }
/// <summary> /// 取消父配置项配置 /// </summary> private void InsProCancelAsParent(HttpContext context) { var insProId = context.Request.QueryString["insProId"]; bool result = false; if (!string.IsNullOrEmpty(insProId)) { result = new InstalledProductBLL().RemoveParent(long.Parse(insProId), LoginUserId); } context.Response.Write(new Tools.Serialize().SerializeJson(result)); }
/// <summary> /// 批量激活选择的配置项 /// </summary> /// <param name="context"></param> /// <param name="ids"></param> public void AvtiveManyIProduct(HttpContext context, string ids, bool isActive) { var result = new InstalledProductBLL().AvtiveManyIProduct(ids, LoginUserId, isActive); if (result) { context.Response.Write("ok"); } else { context.Response.Write("error"); } }
protected void Page_Load(object sender, EventArgs e) { var insProId = Request.QueryString["insProId"]; long id = 0; if (!string.IsNullOrEmpty(insProId) && long.TryParse(insProId, out id)) { thisInsPro = insProBll.GetById(id); } if (thisInsPro == null) { Response.Write("<script>alert('未获取到相关配置项!');window.close();</script>"); return; } noCloseTicket = new DAL.sdk_task_dal().GetNoDoneByInsPro(thisInsPro.id); thisProduct = new ProductBLL().GetProduct(thisInsPro.product_id); wareList = new DAL.ivt_warehouse_dal().GetAllWareList(); if (thisInsPro.account_id != null) { thisAccount = new CompanyBLL().GetCompany((long)thisInsPro.account_id); contactList = new ContactBLL().GetContactByCompany((long)thisInsPro.account_id); } if (thisInsPro.contract_id != null) { thisContract = new ContractBLL().GetContract((long)thisInsPro.contract_id); } var thisSubAllList = new DAL.crm_subscription_dal().GetSubByInsProId(thisInsPro.id); thisSubList = new InstalledProductBLL().ReturnSubIds(thisSubAllList); if (thisSubList != null && thisSubList.Count > 0) { thisSubList.ForEach(_ => { subNames += _.name + ','; }); if (!string.IsNullOrEmpty(subNames)) { subNames = subNames.Substring(0, subNames.Length - 1); } } if (IsPostBack) { var result = new InstalledProductBLL().SwapConfigItem(GetParam(), LoginUserId); Response.Write($"<script>self.opener.location.reload();alert('替换{(result?"成功":"失败")}!');window.close();</script>"); } }
protected void save_add_Click(object sender, EventArgs e) { var result = false; if (isAdd) { result = new InstalledProductBLL().ConfigurationItemAdd(GetPara(), GetLoginUserId()); if (result) { Response.Write("<script>alert('添加配置项成功!');window.open('AddOrEditConfigItem.aspx?account_id=" + param.account_id + "','" + (int)EMT.DoneNOW.DTO.OpenWindow.AddInstalledProduct + "');window.close();</script>"); } } else { result = new InstalledProductBLL().EditConfigurationItem(GetPara(), GetLoginUserId()); if (result) { Response.Write("<script>alert('修改配置项成功!');window.open('AddOrEditConfigItem.aspx?account_id=" + param.account_id + "','" + (int)EMT.DoneNOW.DTO.OpenWindow.AddInstalledProduct + "');window.close();</script>"); } } }
protected void save_close_Click(object sender, EventArgs e) { var result = false; if (isAdd) { result = new InstalledProductBLL().ConfigurationItemAdd(GetPara(), GetLoginUserId()); if (result) { Response.Write("<script>alert('添加配置项成功!');window.close();self.opener.location.reload();</script>"); } } else { result = new InstalledProductBLL().EditConfigurationItem(GetPara(), GetLoginUserId()); if (result) { Response.Write("<script>alert('修改配置项成功!');window.close();self.opener.location.reload();</script>"); } } }
protected void save_Click(object sender, EventArgs e) { var result = false; if (isAdd) { result = new InstalledProductBLL().ConfigurationItemAdd(GetPara(), GetLoginUserId()); if (result) { Response.Write("<script>alert('添加配置项成功!');location.href='AddOrEditConfigItem.aspx?id=" + param.id + "&account_id=" + param.account_id + "';self.opener.location.reload();</script>"); } } else { result = new InstalledProductBLL().EditConfigurationItem(GetPara(), GetLoginUserId()); if (result) { Response.Write("<script>alert('修改配置项成功!');location.href='AddOrEditConfigItem.aspx?id=" + param.id + "&account_id=" + param.account_id + "';self.opener.location.reload();</script>"); } } }
protected void btnFinish_Click(object sender, EventArgs e) { var ChooseProId = Request.Form["ChooseProId"]; if (!string.IsNullOrEmpty(ChooseProId)) { var chooseProArr = ChooseProId.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); int sucessNum = 0; foreach (var chooseProId in chooseProArr) { var param = GetParam(chooseProId); var result = new InstalledProductBLL().ConfigurationItemAdd(param, GetLoginUserId()); if (result) { sucessNum++; } } if (sucessNum > 0) { conCost.create_ci = 1; AddChargeDto dto = new AddChargeDto() { cost = conCost, isAddCongigItem = false }; bool isDelShiCost = false; var isHasPurchaseOrder = ""; new ContractCostBLL().UpdateCost(dto, GetLoginUserId(), out isDelShiCost, out isHasPurchaseOrder); ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('配置项向导成功!');window.close();self.opener.location.reload();</script>"); } else { ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('配置项向导失败!');window.close();self.opener.location.reload();</script>"); } } else { ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>window.close();self.opener.location.reload();</script>"); } }
public void DeleteIProducts(HttpContext context, string ids) { var result = new InstalledProductBLL().DeleteIProducts(ids, LoginUserId); context.Response.Write(result); }
public void DeleteIProduct(HttpContext context, long iProduct_id) { var result = new InstalledProductBLL().DeleteIProduct(iProduct_id, LoginUserId); context.Response.Write(result); }
/// <summary> /// 激活当前的配置项 /// </summary> /// <param name="context"></param> /// <param name="iProduct_id"></param> public void ActivationInstalledProduct(HttpContext context, long iProduct_id, bool isActive) { var result = new InstalledProductBLL().ActivationInstalledProduct(iProduct_id, LoginUserId, isActive); context.Response.Write(result); }
public void ActiveSubscriptions(HttpContext context, string sids, int status_id) { var result = new InstalledProductBLL().ActiveSubsctiptions(sids, LoginUserId, status_id); context.Response.Write(result); }
public void DeleteSubscriptions(HttpContext context, string sids) { var result = new InstalledProductBLL().DeleteSubsctiptions(sids, LoginUserId); context.Response.Write(result); }
/// <summary> /// 解除配置项与合同的绑定 /// </summary> /// <param name="context"></param> /// <param name="contract_id"></param> /// <param name="ipID"></param> private void RelieveInsProduct(HttpContext context, long contract_id, long ipID) { var result = new InstalledProductBLL().RelieveInsProduct(contract_id, ipID, LoginUserId); context.Response.Write(result); }
/// <summary> /// 将配置项绑定到合同 /// </summary> /// <param name="context"></param> /// <param name="contract_id"></param> /// <param name="ipID"></param> private void RelationInsProduct(HttpContext context, long contract_id, long ipID, long?service_id = null) { var result = new InstalledProductBLL().RelationInsProduct(contract_id, ipID, LoginUserId, service_id); context.Response.Write(result); }
protected void btnFinish_Click(object sender, EventArgs e) { var QuoteConfigItemDto = new QuoteConfigItemDto(); var proItemIds = Request.Form["ChooseProductIds"]; if (!string.IsNullOrEmpty(proItemIds)) { List <InsProDto> proList = new List <InsProDto>(); var proItemIdArr = proItemIds.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); foreach (var proItemId in proItemIdArr) { var thisProItemArr = proItemId.Split('_'); var InsProDto = new InsProDto(); InsProDto.itemId = long.Parse(thisProItemArr[0]); var start_date = Request.Form[proItemId + "_start_date"]; if (!string.IsNullOrEmpty(start_date)) { InsProDto.insDate = DateTime.Parse(start_date); } var through_date = Request.Form[proItemId + "_through_date"]; if (!string.IsNullOrEmpty(through_date)) { InsProDto.expDate = DateTime.Parse(through_date); } InsProDto.pageProId = proItemId; InsProDto.serNumber = Request.Form[proItemId + "_serial_number"]; InsProDto.refNumber = Request.Form[proItemId + "_reference_number"]; InsProDto.refName = Request.Form[proItemId + "_reference_name"]; proList.Add(InsProDto); } QuoteConfigItemDto.insProList = proList; } var chooseSubIds = Request.Form["ChooseSubIds"]; if (!string.IsNullOrEmpty(chooseSubIds)) { List <InsProSubDto> proList = new List <InsProSubDto>(); var subProItemIdArr = chooseSubIds.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); foreach (var subProItemId in subProItemIdArr) { var thisSubProItemArr = subProItemId.Split('_'); var InsProSubDto = new InsProSubDto(); InsProSubDto.insProId = thisSubProItemArr[0] + '_' + thisSubProItemArr[1]; InsProSubDto.subName = Request.Form[InsProSubDto.insProId + "_name"]; InsProSubDto.subDes = Request.Form[InsProSubDto.insProId + "_des"]; InsProSubDto.perType = int.Parse(Request.Form[InsProSubDto.insProId + "_period"]); var start_date = Request.Form[subProItemId + "_start_date"]; if (!string.IsNullOrEmpty(start_date)) { InsProSubDto.effDate = DateTime.Parse(start_date); } var through_date = Request.Form[subProItemId + "_through_date"]; if (!string.IsNullOrEmpty(through_date)) { InsProSubDto.expDate = DateTime.Parse(through_date); } var per_price = Request.Form[subProItemId + "_per_price"]; if (!string.IsNullOrEmpty(per_price)) { InsProSubDto.sunPerPrice = decimal.Parse(per_price); } proList.Add(InsProSubDto); } QuoteConfigItemDto.insProSubList = proList; } var chooseChargeIds = Request.Form["ChooseChargeIds"]; if (!string.IsNullOrEmpty(chooseChargeIds)) { List <InsChargeDto> proList = new List <InsChargeDto>(); var chaItemIdArr = chooseChargeIds.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); foreach (var chaItemId in chaItemIdArr) { var thisChaItemArr = chaItemId.Split('_'); var ChaItemDto = new InsChargeDto(); ChaItemDto.itemId = long.Parse(thisChaItemArr[0]); var product_id = Request.Form[thisChaItemArr[0] + '_' + thisChaItemArr[1] + "_product_id"]; if (!string.IsNullOrEmpty(product_id)) { ChaItemDto.productId = long.Parse(product_id); } var insDate = Request.Form[thisChaItemArr[0] + '_' + thisChaItemArr[1] + "_charge_start_date"]; if (!string.IsNullOrEmpty(insDate)) { ChaItemDto.insDate = DateTime.Parse(insDate); } var through_date = Request.Form[thisChaItemArr[0] + '_' + thisChaItemArr[1] + "_charge_through_date"]; if (!string.IsNullOrEmpty(through_date)) { ChaItemDto.warExpDate = DateTime.Parse(through_date); } ChaItemDto.serNumber = Request.Form[thisChaItemArr[0] + '_' + thisChaItemArr[1] + "_charge_serial_number"]; ChaItemDto.refNumber = Request.Form[thisChaItemArr[0] + '_' + thisChaItemArr[1] + "_charge_reference_number"]; ChaItemDto.refName = Request.Form[thisChaItemArr[0] + '_' + thisChaItemArr[1] + "_charge_reference_name"]; proList.Add(ChaItemDto); } QuoteConfigItemDto.insChargeList = proList; } QuoteConfigItemDto.quote_id = quote.id; if (string.IsNullOrEmpty(proItemIds) && string.IsNullOrEmpty(chooseChargeIds)) { // 代表没有选择生成配置项 - 关闭页面 ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>window.close();self.opener.location.reload();</script>"); } else { var result = new InstalledProductBLL().AddInsProByQuote(QuoteConfigItemDto, LoginUserId); if (result) { ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('保存成功!');window.close();self.opener.location.reload();</script>"); } else { ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('保存失败!');window.close();self.opener.location.reload();</script>"); } } }