| | |
| | | public string Targetid = ""; //收货方式目标值 |
| | | public string Shifouwanjie = ""; //完结状态 |
| | | public string CorporateClientsid = ""; |
| | | public string strNewKeyid = ""; |
| | | /// <summary> |
| | | /// 在新建时,保存或者是处理附件时先要生成这个Guid |
| | | /// </summary> |
| | | public Guid NewKeyid{ get; set; } |
| | | |
| | | //初始化 |
| | | public AddCorporateClients() |
| | | { |
| | |
| | | try |
| | | { |
| | | |
| | | GetKeyID(); |
| | | this.saveKey.Value = NewKeyid.ToString(); |
| | | |
| | | Targetid = Request["Keyid"].ToString2(); |
| | | CorporateClientsid = Targetid; |
| | | switch (Request["datatype"].ToString2()) |
| | |
| | | Response.Write("-1"); |
| | | } |
| | | Response.End(); |
| | | |
| | | } |
| | | |
| | | //提交事件 |
| | |
| | | OA_CorporateClients m_OA_CorporateClients = new OA_CorporateClients(); |
| | | OA_CustomerCommunications m_OA_CustomerCommunications = new OA_CustomerCommunications(); |
| | | EC_AcceptWayByCustomers m_EC_AcceptWayByCustomers = new EC_AcceptWayByCustomers(); |
| | | |
| | | if ( this.selSourcesInfoId.Value.ToString() == "452" && string.IsNullOrWhiteSpace(this.txtJigoudaima.Value.ToString())) |
| | | { |
| | | JavaScript.MessageBox("客户来源为政府采购,请填写机构代码", this); |
| | | return; |
| | | } |
| | | try |
| | | { |
| | | Guid Keyid = Request["Keyid"].ToGuid2(); |
| | | //var files = Request.Files; |
| | | //for (int iFile = 0; iFile < files.Count; iFile++) |
| | | //{ |
| | | // ///'检查文件扩展名字 |
| | | // HttpPostedFile postedFile = files[iFile]; |
| | | // string fileName, fileExtension; |
| | | // fileName = System.IO.Path.GetFileName(postedFile.FileName); |
| | | // if (fileName != "") |
| | | // { |
| | | // fileExtension = System.IO.Path.GetExtension(fileName); |
| | | // //strMsg.Append("上传的文件类型:" + postedFile.ContentType.ToString() + "<br>"); |
| | | // //strMsg.Append("客户端文件地址:" + postedFile.FileName + "<br>"); |
| | | // //strMsg.Append("上传文件的文件名:" + fileName + "<br>"); |
| | | // //strMsg.Append("上传文件的扩展名:" + fileExtension + "<br><hr>"); |
| | | // ///'可根据扩展名字的不同保存到不同的文件夹 |
| | | // ///注意:可能要修改你的文件夹的匿名写入权限。 |
| | | // postedFile.SaveAs(System.Web.HttpContext.Current.Request.MapPath("images/") + fileName); |
| | | // } |
| | | //} |
| | | Guid Keyid = Request["Keyid"].ToGuid2(); |
| | | bool isExit = bll_OA_CorporateClientsBLL.isExistCompanyName(this.txtCompanyName.Value.ToString2(), CurrentUser.MemberId, Keyid); |
| | | if (!isExit) |
| | | { |
| | |
| | | } |
| | | |
| | | #region 初始合作客户基础信息 |
| | | m_OA_CorporateClients.CompanyName = this.txtCompanyName.Value.ToString2(); |
| | | m_OA_CorporateClients.CompanyName = this.txtCompanyName.Value.ToString2(); |
| | | m_OA_CorporateClients.CustomerIndustriesId = this.selCustomerIndustriesId.Value.ToInt32() ?? 0; |
| | | m_OA_CorporateClients.CustomerTypeId = this.selCustomerTypeId.Value.ToInt32() ?? 0; |
| | | m_OA_CorporateClients.SourcesInfoId = this.selSourcesInfoId.Value.ToInt32() ?? 0; |
| | | m_OA_CorporateClients.DegreeImportanId = this.selDegreeImportanId.Value.ToInt32() ?? 0; |
| | | m_OA_CorporateClients.AccountManagerId = this.selAccountManagerId.Value.ToInt32() ?? 0; |
| | | m_OA_CorporateClients.BusinessManagerId = this.selBusinessManagerId.Value.ToInt32() ?? 0; |
| | | m_OA_CorporateClients.Shifouwanjie = 2; |
| | | |
| | | //add by zyyao |
| | | m_OA_CorporateClients.Paytime = this.selPaytime.Value.ToInt32() ?? 0; |
| | |
| | | JavaScript.MessageBox("更新成功", this, true, true); |
| | | else |
| | | JavaScript.MessageBox("更新失败", this); |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | m_OA_CorporateClients.IsPriority = false; |
| | | m_OA_CorporateClients.CumulativePrepayments = 0; |
| | | |
| | | m_OA_CorporateClients.Keyid = Guid.NewGuid(); |
| | | m_OA_CorporateClients.Keyid = new Guid( this.saveKey.Value);// Guid.NewGuid();//GetKeyID(); |
| | | m_OA_CorporateClients.CreateTime = DateTime.Now; |
| | | m_OA_CorporateClients.CustomerId = bll_OA_CorporateClientsBLL.GetLastIdByFirmId(CurrentUser.MemberId) + 1; |
| | | m_OA_CorporateClients.FirmId = CurrentUser.MemberId; |
| | |
| | | JavaScript.MessageBox("完结成功", this, true, true); |
| | | else |
| | | JavaScript.MessageBox("完结失败", this); |
| | | |
| | | |
| | | #endregion |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | //完结事件 |
| | | protected void btn_Submit_Visit(object sender, EventArgs e) |
| | | { |
| | | OA_CorporateClientsVisit m_OA_CorporateClientsVisit = new OA_CorporateClientsVisit(); |
| | | ////完结事件 |
| | | //protected void btn_Submit_Visit(object sender, EventArgs e) |
| | | //{ |
| | | // OA_CorporateClientsVisit m_OA_CorporateClientsVisit = new OA_CorporateClientsVisit(); |
| | | |
| | | |
| | | try |
| | | { |
| | | Guid Keyid = Request["Keyid"].ToGuid2(); |
| | | // try |
| | | // { |
| | | // Guid Keyid = Request["Keyid"].ToGuid2(); |
| | | |
| | | |
| | | |
| | | |
| | | if (Request["Keyid"] != null) |
| | | { |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | | JavaScript.MessageBox("请先保存客户", this); |
| | | } |
| | | |
| | | if (this.txtVisitTime.Value=="") |
| | | { |
| | | JavaScript.MessageBox("请选择日期", this); |
| | | |
| | | } |
| | | if (this.txtVisitTime.Value == "") |
| | | { |
| | | JavaScript.MessageBox("请填写维护记录", this); |
| | | |
| | | } |
| | | |
| | | m_OA_CorporateClientsVisit.Keyid = Guid.NewGuid(); |
| | | // if (Request["Keyid"] != null) |
| | | // { |
| | | |
| | | |
| | | m_OA_CorporateClientsVisit.CorporateClientsid = Keyid; |
| | | // } |
| | | // else |
| | | // { |
| | | // JavaScript.MessageBox("请先保存客户", this); |
| | | // } |
| | | |
| | | m_OA_CorporateClientsVisit.VisitTime = this.txtVisitTime.Value.ToDateTime2(); |
| | | // if (this.txtVisitTime.Value == "") |
| | | // { |
| | | // JavaScript.MessageBox("请选择日期", this); |
| | | |
| | | m_OA_CorporateClientsVisit.Remark = this.txtvisitRemark.Value.ToString2(); |
| | | m_OA_CorporateClientsVisit.Creater = CurrentUser.TrueMemberId; |
| | | m_OA_CorporateClientsVisit.CreateTime = DateTime.Now; |
| | | m_OA_CorporateClientsVisit.Updater = CurrentUser.TrueMemberId; |
| | | m_OA_CorporateClientsVisit.LastUpdateTime = DateTime.Now; |
| | | // } |
| | | // if (this.txtVisitTime.Value == "") |
| | | // { |
| | | // JavaScript.MessageBox("请填写维护记录", this); |
| | | |
| | | // } |
| | | |
| | | // m_OA_CorporateClientsVisit.Keyid = Guid.NewGuid(); |
| | | |
| | | |
| | | #region 添加或编辑 |
| | | // m_OA_CorporateClientsVisit.CorporateClientsid = Keyid; |
| | | |
| | | // m_OA_CorporateClientsVisit.VisitTime = this.txtVisitTime.Value.ToDateTime2(); |
| | | |
| | | // m_OA_CorporateClientsVisit.Remark = this.txtvisitRemark.Value.ToString2(); |
| | | // m_OA_CorporateClientsVisit.Creater = CurrentUser.TrueMemberId; |
| | | // m_OA_CorporateClientsVisit.CreateTime = DateTime.Now; |
| | | // m_OA_CorporateClientsVisit.Updater = CurrentUser.TrueMemberId; |
| | | // m_OA_CorporateClientsVisit.LastUpdateTime = DateTime.Now; |
| | | |
| | | |
| | | bool result = bll_OA_CorporateClientsBLL.InsertModelVisit(m_OA_CorporateClientsVisit);//更新信息 |
| | | |
| | | if (result) |
| | | { |
| | | //this.RepClientList.DataSource = bll_OA_CorporateClientsBLL.SelectVisitListByCorId(Keyid); |
| | | //this.RepClientList.DataBind(); |
| | | this.txtVisitTime.Value = ""; |
| | | this.txtvisitRemark.Value = ""; |
| | | JavaScript.MessageBox("维护保存成功", this, false, false); |
| | | } |
| | | |
| | | else |
| | | JavaScript.MessageBox("维护保存失败", this); |
| | | |
| | | Province = CurrentUser.Province; |
| | | City = CurrentUser.City; |
| | | County = CurrentUser.County; |
| | | BindData(); |
| | | #endregion |
| | | // #region 添加或编辑 |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | PAGEHandleException(ex); |
| | | JavaScript.MessageBox("操作失败", this); |
| | | } |
| | | } |
| | | // bool result = bll_OA_CorporateClientsBLL.InsertModelVisit(m_OA_CorporateClientsVisit);//更新信息 |
| | | |
| | | // if (result) |
| | | // { |
| | | // //this.RepClientList.DataSource = bll_OA_CorporateClientsBLL.SelectVisitListByCorId(Keyid); |
| | | // //this.RepClientList.DataBind(); |
| | | // this.txtVisitTime.Value = ""; |
| | | // this.txtvisitRemark.Value = ""; |
| | | // JavaScript.MessageBox("维护保存成功", this, false, false); |
| | | // } |
| | | |
| | | // else |
| | | // JavaScript.MessageBox("维护保存失败", this); |
| | | |
| | | // Province = CurrentUser.Province; |
| | | // City = CurrentUser.City; |
| | | // County = CurrentUser.County; |
| | | // BindData(); |
| | | // #endregion |
| | | |
| | | |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // PAGEHandleException(ex); |
| | | // JavaScript.MessageBox("操作失败", this); |
| | | // } |
| | | //} |
| | | |
| | | //绑定数据 |
| | | protected void BindData() |
| | |
| | | this.selSourcesInfoId.DataValueField = "Keyid"; |
| | | this.selSourcesInfoId.DataTextField = "Name"; |
| | | this.selSourcesInfoId.DataBind(); |
| | | this.selSourcesInfoId.Value = "452"; |
| | | |
| | | this.selCustomerIndustriesId.DataSource = bll_Sys_DictionaryBLL.GetDataByType("客户所属行业"); |
| | | this.selCustomerIndustriesId.DataValueField = "Keyid"; |
| | | this.selCustomerIndustriesId.DataTextField = "Name"; |
| | | this.selCustomerIndustriesId.DataBind(); |
| | | |
| | | this.selCustomerIndustriesId.Value = "69"; |
| | | |
| | | this.selCustomerTypeId.DataSource = bll_Sys_DictionaryBLL.GetDataByType("客户类型"); |
| | | this.selCustomerTypeId.DataValueField = "Keyid"; |
| | |
| | | this.selBusinessManagerId.DataBind(); |
| | | this.selBusinessManagerId.Items.Insert(0, new ListItem("请选择", "")); |
| | | |
| | | this.selBusinessManagerId.Value = CurrentUser.StaffId.Value.ToString(); |
| | | |
| | | this.selAccountManagerId.DataSource = bll_OA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId, false, true); |
| | | this.selAccountManagerId.DataTextField = "Name"; |
| | | this.selAccountManagerId.DataValueField = "Keyid"; |
| | | this.selAccountManagerId.DataBind(); |
| | | this.selAccountManagerId.Items.Insert(0, new ListItem("请选择", "")); |
| | | |
| | | this.selAccountManagerId.Value = CurrentUser.StaffId.Value.ToString(); |
| | | |
| | | this.selCreditId.DataSource = bll_Sys_DictionaryBLL.GetDataByType("客户信誉"); |
| | | this.selCreditId.DataValueField = "Keyid"; |
| | |
| | | return ("[" + string.Join(",", modelArry) + "]"); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 获取Guid |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public Guid GetKeyID() |
| | | { |
| | | if (NewKeyid != null && NewKeyid != new Guid("00000000-0000-0000-0000-000000000000")) |
| | | { |
| | | strNewKeyid = NewKeyid.ToString(); |
| | | return NewKeyid; |
| | | } |
| | | |
| | | if (Request["Keyid"] != null) |
| | | { |
| | | NewKeyid = Request["Keyid"].ToGuid2(); |
| | | // this.SaveNewKeyID.Value = NewKeyid.ToString(); |
| | | strNewKeyid = NewKeyid.ToString(); |
| | | return NewKeyid; |
| | | } |
| | | |
| | | |
| | | if (this.saveKey.Value == "") |
| | | { |
| | | NewKeyid = Guid.NewGuid(); |
| | | this.saveKey.Value = NewKeyid.ToString(); |
| | | return NewKeyid; |
| | | } |
| | | else |
| | | { |
| | | NewKeyid = new Guid(this.saveKey.Value); |
| | | return NewKeyid; |
| | | } |
| | | |
| | | } |
| | | |
| | | //CY.WebForm.cs.UploadCS.UpFileResult _UpFileResult1 = CY.WebForm.cs.UploadCS.Upload( |
| | | |
| | | //提交事件 |
| | | protected void btn_SubmitClientsBiddingcompany_Config(object sender, EventArgs e) |