Exemple #1
0
        /// <summary>
        /// 添加一个申请单
        /// </summary>
        /// <param name="modelMainBill">主表</param>
        /// <param name="modelTravelApplication">记录申请表之外的信息</param>
        /// <param name="strMsg"></param>
        /// <returns></returns>
        public int AddNote(Models.Bill_Main modelMainBill, Models.T_SpecialRebatesAppmode spemode, out string strMsg)
        {
            try
            {
                strMsg = "";
                if (modelMainBill == null || spemode == null)
                {
                    throw new Exception("主表或出差申请单模型不能为空");
                }
                //bool isSpecial = IsSpecialRebatesTruckCode(spemode.TruckCode);
                //bool iskpsq = IsKpsqTruckCode(spemode.TruckCode);
                //if (!iskpsq)
                //{
                //    if (!isSpecial)
                //    {
                //主表
                int iMainRel = bllMainBill.Add(modelMainBill);
                if (iMainRel <= 0)
                {
                    throw new Exception("向主表插入数据时发生未知错误!");
                }
                //出差申请单
                string[] strTravelPersionCode = spemode.SysPersionCode.Split(new string[] { "|&|" }, StringSplitOptions.RemoveEmptyEntries);
                int      iPersionLength       = strTravelPersionCode.Length;
                if (iPersionLength <= 0)
                {
                    throw new Exception("出差申请人个数不能为0!");
                }
                //  Delete(spemode.Code);
                int iRel = this.Add(spemode);

                return(1);

                //    }
                //    else
                //    {
                //        throw new Exception("该车辆已经申请过特殊返利!");
                //        return -1;
                //    }

                //}
                //else
                //{
                //    throw new Exception("该车辆已经做过开票申请!");
                //    return -1;
                //}
            }
            catch (Exception ex)
            {
                strMsg = ex.Message;
                return(-1);
            }
        }
Exemple #2
0
 /// <summary>
 /// 添加model到申请单表
 /// </summary>
 /// <param name="modelTravelApplication"></param>
 /// <returns></returns>
 public int Add(Models.T_SpecialRebatesAppmode spemode)
 {
     return(specidal.Add(spemode));
 }