/// <summary> /// 保存提成 /// </summary> /// <param name="cableid">电路ID</param> /// <param name="salerid">销售ID</param> /// <param name="salerType">销售人员类型</param> public static void saveCommission(int cableid, int salerid, int salerType, string cablestatus, DateTime startTime, int cableclass, int businessTypeid, RatioDate ratio) { try { decimal ratiovalue = 0; decimal taxvalue = 0; string dataname = cablestatus; //DataTable tb = getCableRatio(cableclass,businessTypeid); if (salerType == (int)EnmDataType.主销售渠道) { //dataname = "主销售渠道" + dataname; //DataRow row = tb.Select("dataname='" + dataname + "'")[0]; ratiovalue = ratio.RatioMian; taxvalue = ratio.TaxMain; } else if (salerType == (int)EnmDataType.完工录入) { //dataname = "完工录入" + dataname; //DataRow row = tb.Select("dataname='" + dataname + "'")[0]; ratiovalue = ratio.RatioWrite; taxvalue = ratio.TaxWrite; } else if (salerType == (int)EnmDataType.销售渠道) { //dataname = "销售渠道" + dataname; //DataRow row = tb.Select("dataname='" + dataname + "'")[0]; ratiovalue = ratio.RatioSaler; taxvalue = ratio.TaxSaler; } Commission c = new Commission(); c.Cableid = cableid; c.Userid = salerid; c.Usertype = salerType; c.Tax = taxvalue; c.Ratio = ratiovalue; c.Begintime = startTime.Date; c.Isdeleted = (int)EnmIsdeleted.使用中; c.Create(); } catch (Exception ex) { MessageHelper.ShowMessage("E999", ex.Message); } }
/// <summary> /// 保存提成、税率 /// </summary> /// <param name="cableid">电路ID</param> /// <param name="salerid">渠道ID</param> /// <param name="ratio">提成率</param> /// <param name="tax">税率</param> public static bool saveCommission(int cableid, int salerid, int usertype, decimal ratio, decimal tax, DateTime start) { try { Commission c = new Commission(); c.Cableid = cableid; c.Userid = salerid; c.Usertype = usertype; c.Tax = tax; c.Ratio = ratio; c.Begintime = start; c.Isdeleted = (int)EnmIsdeleted.使用中; c.Create(); return(true); } catch (Exception ex) { MessageHelper.ShowMessage("E999", "保存提成信息发生错误。"); return(false); } }