本文整理汇总了C#中CM_ClientBLL.Update方法的典型用法代码示例。如果您正苦于以下问题:C# CM_ClientBLL.Update方法的具体用法?C# CM_ClientBLL.Update怎么用?C# CM_ClientBLL.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CM_ClientBLL
的用法示例。
在下文中一共展示了CM_ClientBLL.Update方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: bt_AddApply_Click
protected void bt_AddApply_Click(object sender, EventArgs e)
{
bt_OK_Click(null, null);
if ((int)ViewState["ClientID"] == 0)
{
MessageBox.Show(this, "对不起,请您先保存后在发起申请");
return;
}
CM_ClientBLL bll = new CM_ClientBLL((int)ViewState["ClientID"]);
NameValueCollection dataobjects = new NameValueCollection();
dataobjects.Add("ID", ViewState["ClientID"].ToString());
dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
dataobjects.Add("ClientName", bll.Model.FullName.ToString());
dataobjects.Add("OperateClassify", bll.Model["OperateClassify"]);
dataobjects.Add("DIClassify", bll.Model["DIClassify"]);
int TaskID = EWF_TaskBLL.NewTask("Add_Distributor", (int)Session["UserID"], "新增经销商流程,经销商名称:" + bll.Model.FullName, "~/SubModule/CM/DI/DistributorDetail.aspx?ClientID=" + ViewState["ClientID"].ToString(), dataobjects);
if (TaskID > 0)
{
bll.Model["TaskID"] = TaskID.ToString();
bll.Model["State"] = "2";
bll.Update();
//new EWF_TaskBLL(TaskID).Start(); //直接启动流程
}
Response.Redirect("~/SubModule/EWF/Apply.aspx?TaskID=" + TaskID.ToString());
}
示例2: bt_AddApply_Click
protected void bt_AddApply_Click(object sender, EventArgs e)
{
bt_OK_Click(null, null);
if (CM_LinkManBLL.GetModelList("ClientID=" + ViewState["ClientID"].ToString()).Count == 0)
{
MessageBox.Show(this, "对不起,请至少提供一名客户联系人!");
return;
}
CM_ClientBLL bll = new CM_ClientBLL((int)ViewState["ClientID"]);
NameValueCollection dataobjects = new NameValueCollection();
dataobjects.Add("ID", bll.Model.ID.ToString());
dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
dataobjects.Add("ClientName", bll.Model.FullName);
dataobjects.Add("Channel", bll.Model["RTChannel"]);
dataobjects.Add("StoreAnalysis", bll.Model["Store_Analysis"]);
dataobjects.Add("IsACClient", bll.Model["IsACClient"]);
int TaskID = EWF_TaskBLL.NewTask("Add_Retailer", (int)Session["UserID"], "终端门店名称:" + bll.Model.FullName, "~/SubModule/CM/RT/RetailerDetail.aspx?ClientID=" + ViewState["ClientID"].ToString(), dataobjects);
if (TaskID > 0)
{
bll.Model["TaskID"] = TaskID.ToString();
bll.Model["State"] = "2";
bll.Update();
//new EWF_TaskBLL(TaskID).Start(); //直接启动流程
}
Response.Redirect("~/SubModule/EWF/Apply.aspx?TaskID=" + TaskID.ToString());
}
示例3: bt_Approve_Click
protected void bt_Approve_Click(object sender, EventArgs e)
{
if ((int)ViewState["ClientID"] != 0)
{
CM_ClientBLL _bll = new CM_ClientBLL((int)ViewState["ClientID"]);
_bll.Model.ApproveFlag = 1;
_bll.Update();
MessageBox.ShowAndRedirect(this, "审核仓库资料成功!", "StoreDetail.aspx?ClientID=" + ViewState["ClientID"].ToString());
}
}
示例4: bt_Approve_Click
protected void bt_Approve_Click(object sender, EventArgs e)
{
if ((int)ViewState["ClientID"] != 0)
{
CM_ClientBLL _bll = new CM_ClientBLL((int)ViewState["ClientID"]);
_bll.Model.ActiveFlag = 1;
if (_bll.Model.OpenTime.Year == 1900) _bll.Model.OpenTime = DateTime.Today;
_bll.Model.CloseTime = new DateTime(1900, 1, 1);
_bll.Model.ApproveFlag = 1;
_bll.Update();
MessageBox.ShowAndRedirect(this, "审核经销商资料成功!", "DistributorDetail.aspx?ClientID=" + ViewState["ClientID"].ToString());
}
}
示例5: bt_OK_Click
protected void bt_OK_Click(object sender, EventArgs e)
{
CM_ClientBLL _bll = null;
int ClientID = (int)Session["OwnerClient"];
_bll = new CM_ClientBLL(ClientID);
pl_detail.GetData(_bll.Model);
#region 判断修改项
#endregion
_bll.Model.UpdateStaff = (int)Session["UserID"];
_bll.Model.OwnerClient = (int)Session["OwnerClient"];
if(_bll.Update()==0)
MessageBox.Show(this, "经销商资料修改成功!");
}
示例6: RetailerUpdate
/// <summary>
/// 新增门店资料
/// </summary>
/// <param name="User">用户</param>
/// <param name="TDP"></param>
/// <param name="ClientJson">门店资料Json</param>
/// <returns>大于0:新增的门店ID -1:Json字符串无法解析 -2:所属经销商无效 -3:更新门店基本资料失败</returns>
public static int RetailerUpdate(UserInfo User, int TDP, ClientInfo Client, out string ErrorInfo)
{
ErrorInfo = "";
LogWriter.WriteLog("PBMIFService.RetailerUpdate:UserName=" + User.UserName + ",TDP=" + TDP.ToString()
+ ",ClientInfo=" + JsonConvert.SerializeObject(Client));
if (User.OwnerType == 3) TDP = User.ClientID;
try
{
ClientInfo c = Client;
if (c == null) { ErrorInfo = "Json字符串无法解析"; return -1; } //Json字符串无法解析
CM_Client TDPClient = new CM_ClientBLL(TDP).Model;
if (TDPClient == null) { ErrorInfo = "所属经销商无效"; return -2; } //所属经销商无效
#region 判断必填与重复检测
if (c.FullName == "") { ErrorInfo = "门店名称必填"; return -10; }
if (c.Mobile == "") { ErrorInfo = "联系电话必填"; return -10; }
if (c.Address == "") { ErrorInfo = "门店地址必填"; return -10; }
if (c.Mobile.StartsWith("01")) c.Mobile = c.Mobile.Substring(1);
if (c.TeleNum.Contains("-")) c.TeleNum = c.TeleNum.Replace("-", "");
if (c.Mobile.Contains("-")) c.Mobile = c.Mobile.Replace("-", "");
//检查门店资料重复
int rptclientid = CM_ClientBLL.CheckRepeat(TDP, Client.ID, c.Mobile, c.TeleNum, c.FullName, c.Address);
if (rptclientid > 0)
{
CM_Client _rptclient = new CM_ClientBLL(rptclientid).Model;
ErrorInfo = "门店资料与[" + _rptclient.FullName + "]资料重复,请勿重复新增!";
return -11;
}
#endregion
CM_ClientBLL bll = new CM_ClientBLL(c.ID);
#region 门店基本资料
bll.Model.Code = c.Code;
bll.Model.FullName = c.FullName != "" ? c.FullName : c.ShortName;
bll.Model.ShortName = c.ShortName == "" ? c.FullName : c.ShortName;
if (c.OfficialCity > 0)
bll.Model.OfficialCity = c.OfficialCity;
else
bll.Model.OfficialCity = TDPClient.OfficialCity;
if (bll.Model.DeliveryAddress == bll.Model.Address)
bll.Model.DeliveryAddress = c.Address;
bll.Model.Address = c.Address;
bll.Model.LinkManName = c.LinkManName;
bll.Model.TeleNum = c.TeleNum == "" ? c.Mobile : c.TeleNum;
if (c.Mobile.StartsWith("1") && c.Mobile.Length == 11) bll.Model.Mobile = c.Mobile;
bll.Model.UpdateStaff = User.StaffID;
#endregion
int retailerid = bll.Update();
if (retailerid < 0) return -3; //更新门店基本资料失败
#region 设置供货商信息
CM_ClientSupplierInfo supplierinfo = bll.GetSupplierInfo(TDP);
supplierinfo.Code = c.CodeBySupplier;
supplierinfo.StandardPrice = c.StandardPrice;
supplierinfo.TDPChannel = c.TDPChannel;
supplierinfo.TDPSalesArea = c.TDPSalesArea;
supplierinfo.VisitRoute = c.VisitRoute;
supplierinfo.VisitSequence = c.VisitSequence;
supplierinfo.VisitTemplate = c.VisitTemplate;
supplierinfo.UpdateStaff = User.StaffID;
bll.SetSupplierInfo(supplierinfo);
#endregion
#region 设置厂商管理信息
#endregion
return 0;
}
catch (System.Exception err)
{
LogWriter.WriteLog("PBMIFService.RetailerAdd Exception Error!", err);
return -100;
}
}
示例7: bt_RevocationApply_Click
protected void bt_RevocationApply_Click(object sender, EventArgs e)
{
CM_ClientBLL bll = new CM_ClientBLL((int)ViewState["ClientID"]);
if (PM_PromotorInRetailerBLL.GetModelList("Client=" + bll.Model.ID.ToString() + " AND EXISTS(SELECT 1 FROM MCS_Promotor.dbo.PM_Promotor WHERE PM_Promotor.ID=PM_PromotorInRetailer.Promotor AND Dimission=1 AND ApproveFlag=1)").Count > 0)
{
MessageBox.Show(this, "该门店还有关联的导购,请转移或解除与该门店的关系!");
return;
}
NameValueCollection dataobjects = new NameValueCollection();
dataobjects.Add("ID", ViewState["ClientID"].ToString());
dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
dataobjects.Add("ClientName", bll.Model.FullName.ToString());
dataobjects.Add("Channel", bll.Model["RTChannel"]);
dataobjects.Add("CloseTime", DateTime.Now.ToShortDateString());
dataobjects.Add("Remark", "门店终止合作");
dataobjects.Add("IsKeyClient", bll.Model["IsKeyClient"].ToString());
int TaskID = EWF_TaskBLL.NewTask("Revocation_Retailer", (int)Session["UserID"], "撤销门店,名称:" + bll.Model.FullName, "~/SubModule/CM/RT/RetailerDetail.aspx?ClientID=" + ViewState["ClientID"].ToString(), dataobjects);
if (TaskID > 0)
{
bll.Model["TaskID"] = TaskID.ToString();
bll.Model["State"] = "2";
bll.Update();
}
Response.Redirect("~/SubModule/EWF/Apply.aspx?TaskID=" + TaskID.ToString());
}
示例8: bt_OK_Click
protected void bt_OK_Click(object sender, EventArgs e)
{
int ApproveCount = 0, UnApproveCount = 0, errcount = 0, LoseApproveCount = 0;
string[] mixed;
if (txt_OpenID.Text.Trim() != "")
{
string[] OpenID = Regex.Split(txt_OpenID.Text.Trim().Replace("\r\n", "\n").Replace(" ", "\n"), "\n", RegexOptions.IgnoreCase);
if (txt_CloseID.Text.Trim() != "")
{
string[] CloseID = Regex.Split(txt_CloseID.Text.Trim().Replace("\r\n", "\n").Replace(" ", "\n"), "\n", RegexOptions.IgnoreCase);
if (!CheckID(OpenID, CloseID, out mixed))
{
MessageBox.Show(this, "客户代码为【" + mixed[0] + "】的客户代码同时出现在了【开通】与【关闭】编辑框中!");
return;
}
}
}
if (txt_OpenID.Text.Trim() != "")
{
string[] OpenID = Regex.Split(txt_OpenID.Text.Trim().Replace("\r\n", "\n").Replace(" ", "\n"), "\n", RegexOptions.IgnoreCase);
CM_ClientBLL _bll;
StringBuilder approvebuild = new StringBuilder("");
for (int i = 0; i < OpenID.Length; i++)
{
if (!OpenID[i].Trim().Equals(""))
{
IList<CM_Client> cmlist = CM_ClientBLL.GetModelList("Code='" + OpenID[i].Trim()+"'");
if (cmlist.Count > 0)
{
_bll = new CM_ClientBLL(cmlist[0].ID);
_bll.Model["IsRMSClient"] = "3";
_bll.Model["RMSAccountEnabled"] = "1";
_bll.Update();
approvebuild.Append("客户代码为【" + OpenID[i].Trim() + "】的门店已开通积分");
ApproveCount++;
}
else
{
approvebuild.Append("<span style='color: Red'>客户代码为【" + OpenID[i].Trim() + "】的门店未能在系统中找到 </span> ");
errcount++;
}
}
else if (!OpenID[i].Trim().Equals(""))
{
approvebuild.Append("<span style='color: Red'>【" + OpenID[i].Trim() + "】不是一个有效的客户代码</span> ");
errcount++;
}
if (i % 5 == 0 && i != 0) approvebuild.Append("<br/>");
}
lb_OpenErrorInfo.Text = approvebuild.ToString();
}
if (txt_CloseID.Text.Trim() != "")
{
string[] CloseID = Regex.Split(txt_CloseID.Text.Trim().Replace("\r\n", "\n").Replace(" ", "\n"), "\n", RegexOptions.IgnoreCase);
CM_ClientBLL _bll;
StringBuilder unapprovebuild = new StringBuilder("");
for (int i = 0; i < CloseID.Length; i++)
{
if (!CloseID[i].Trim().Equals(""))
{
IList<CM_Client> cmlist = CM_ClientBLL.GetModelList("Code='" + CloseID[i].Trim() + "'");
if (cmlist.Count > 0)
{
_bll = new CM_ClientBLL(cmlist[0].ID);
_bll.Model["IsRMSClient"] = "2";
_bll.Model["RMSAccountEnabled"] = "2";
_bll.Update();
unapprovebuild.Append("客户代码为【" + CloseID[i].Trim() + "】的门店已关闭积分");
UnApproveCount++;
}
else
{
errcount++;
unapprovebuild.Append("<span style='color: Red'>ID为【" + CloseID[i].Trim() + "】的返利协议未能在系统中找到 </span>");
}
}
else if (!CloseID[i].Trim().Equals(""))
{
unapprovebuild.Append("<span style='color: Red'>【" + CloseID[i].Trim() + "】不是一个有效的客户代码 </span>");
errcount++;
}
if (i % 5 == 0 && i != 0) unapprovebuild.Append("<br/>");
}
lb_CloseErrorInfo.Text = unapprovebuild.ToString();
}
MessageBox.Show(this, "开通积分门店个数:" + ApproveCount.ToString() + @"\n关闭积分门店个数:" + UnApproveCount.ToString() +
@"\n未能导入门店个数:" + errcount.ToString());
return;
//.........这里部分代码省略.........
示例9: bt_RevocationApply_Click
protected void bt_RevocationApply_Click(object sender, EventArgs e)
{
#region 判断有无下游客户
if (CM_ClientBLL.GetModelList("Supplier=" + ViewState["ClientID"].ToString() + " AND ActiveFlag=1").Count > 0)
{
MessageBox.Show(this, "对不起,该经销商下还有活跃的下游分销商或门店,无法申请撤销!");
return;
}
#endregion
if (new FNA_FeeApplyBLL().GetDetail(@" Flag IN(1,2,4) AND AvailCost>0 AND EXISTS
(SELECT ID FROM MCS_FNA.dbo.FNA_FeeApply WHERE State=3 AND ApproveFlag=1 AND ID=FNA_FeeApplyDetail.ApplyID
AND Client=" + ViewState["ClientID"] + ")").Count > 0)
{
MessageBox.Show(this, "该经销商下还有费用未做核销,请核销后再撤销!");
return;
}
CM_ClientBLL bll = new CM_ClientBLL((int)ViewState["ClientID"]);
NameValueCollection dataobjects = new NameValueCollection();
dataobjects.Add("ID", ViewState["ClientID"].ToString());
dataobjects.Add("OrganizeCity", bll.Model.OrganizeCity.ToString());
dataobjects.Add("ClientName", bll.Model.FullName.ToString());
dataobjects.Add("CloseTime", DateTime.Now.ToShortDateString());
dataobjects.Add("Remark", "经销商终止合作");
dataobjects.Add("OperateClassify", bll.Model["OperateClassify"]);
dataobjects.Add("DIClassify", bll.Model["DIClassify"]);
string Title = TreeTableBLL.GetSuperNameByLevel("MCS_SYS.dbo.Addr_OrganizeCity", "ID", "Name", "SuperID", bll.Model.OrganizeCity, ConfigHelper.GetConfigInt("OrganizeCity-CityLevel")) + "-" + "经销商中止合作流程";//办事处+经分销商名称+中止流程
int TaskID = EWF_TaskBLL.NewTask("Revocation_Distributor", (int)Session["UserID"], Title, "~/SubModule/CM/DI/DistributorDetail.aspx?ClientID=" + ViewState["ClientID"].ToString(), dataobjects);
if (TaskID > 0)
{
bll.Model["TaskID"] = TaskID.ToString();
bll.Model["State"] = "2";
bll.Update();
}
Response.Redirect("~/SubModule/EWF/Apply.aspx?TaskID=" + TaskID.ToString());
}
示例10: threadStartImport
private void threadStartImport(BackgroundWorker worker, DoWorkEventArgs e)
{
DataTable dt_OfficialCity = Addr_OfficialCityBLL.GetAllOfficialCity();
DataTable dt_OrganizeCity = Addr_OrganizeCityBLL.GetAllOrganizeCity();
DataTable dt_Position = Org_PositionBLL.GetAllPostion();
bool bFind = false;
StringBuilder _xhs_success = new StringBuilder("");//成功导入的记录序号(用于定期批量更新导入标志)
string XH = "";
#region 导入销售人员资料
try
{
if (cbx_Promotor.Checked)
{
lb_Count.Text = dt_SalesStaff.Rows.Count.ToString();
tabControl1.SelectedIndex = 0;
XH = "";
for (int i = 0; i < dt_SalesStaff.Rows.Count; i++)
{
worker.ReportProgress((i + 1) * 100 / this.dt_SalesStaff.Rows.Count, i);
if (worker.CancellationPending)
{
e.Cancel = true;
break;
}
XH = dt_SalesStaff.Rows[i]["序号"].ToString();
Org_StaffBLL staff = new Org_StaffBLL();
//序号
if (dt_SalesStaff.Rows[i]["员工工号"].ToString() != "")
staff.Model["StaffCode"] = dt_SalesStaff.Rows[i]["员工工号"].ToString();
else
staff.Model["StaffCode"] = FormatClientCode('S', dt_SalesStaff.Rows[i]["序号"].ToString().Trim(), dt_SalesStaff.Rows[i]["管理片区代码"].ToString().Trim());
#region 判断数据是否重复
if (Org_StaffBLL.GetStaffList("StaffCode = '" + staff.Model["StaffCode"] + "'").Count > 0)
{
UpdateImportFlag(1, i, "导入失败,数据重复!");
continue;
}
#endregion
//姓名
staff.Model["RealName"] = dt_SalesStaff.Rows[i]["姓名"].ToString().Trim();
//职务
DataRow[] rows_Position = dt_Position.Select("Name = '" + dt_SalesStaff.Rows[i]["职务"].ToString().Trim() + "'");
if (rows_Position.Length == 0)
{
UpdateImportFlag(1, i, "导入失败,职务在系统字典中不存在!");
continue;
}
else
staff.Model["Position"] = rows_Position[0]["ID"].ToString().Trim();
//管理片区代码
DataRow[] rows_OrganizeCity = dt_OrganizeCity.Select("Code='" + dt_SalesStaff.Rows[i]["管理片区代码"].ToString().Trim() + "'");
if (rows_OrganizeCity.Length == 0)
{
UpdateImportFlag(1, i, "导入失败,管理片区代码在系统字典中不存在!");
continue;
}
else
staff.Model["OrganizeCity"] = rows_OrganizeCity[0]["ID"].ToString().Trim();
//性别
staff.Model["Sex"] = dt_SalesStaff.Rows[i]["性别"].ToString();
//bFind = false;
//foreach (Dictionary_Data item in DictionaryBLL.GetDicCollections("Pub_Sex").Values)
//{
// if (item.Name == dt_SalesStaff.Rows[i]["性别"].ToString().Trim())
// {
// staff.Model["Sex"] = item.Code;
// bFind = true;
// break;
// }
//}
//if (!bFind)
//{
// UpdateImportFlag(1, i, "导入失败,性别在系统字典中不存在!");
// continue;
//}
//联系电话
staff.Model["TeleNum"] = dt_SalesStaff.Rows[i]["联系电话"].ToString().Trim();
//手机
staff.Model["Mobile"] = dt_SalesStaff.Rows[i]["手机"].ToString().Trim();
//城市
string cityname = dt_SalesStaff.Rows[i]["城市"].ToString().Trim();
if (cityname.Length > 3) cityname = cityname.Substring(0, 3);
DataRow[] rows_OfficialCity = dt_OfficialCity.Select("Name like '" + cityname + "%'");
if (rows_OfficialCity.Length == 0)
{
UpdateImportFlag(1, i, "导入失败,城市在系统字典中不存在!");
continue;
}
else
//.........这里部分代码省略.........