Exemplo n.º 1
0
 /// <summary>
 /// 加载操作员的提成数据
 /// </summary>
 private void LoadInputerList()
 {
     if (Session["inputercutPay"].ToString() != "")
     {
         string sql = " 1=1 ";
         sql += Session["inputercutPay"];
         this.inputerTc.DataSource = To_OrderInfoManager.GetList(0, sql, "outTime");
         this.inputerTc.DataBind();
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 检验是否能成功产生订单名称
        /// </summary>
        /// <param name="cuscode">输入的付款单位代码</param>
        /// <param name="cname">付款单位代码全称</param>
        /// <param name="attachment">>付款单位代码不包含流水号</param>
        /// <param name="txt">流水号</param>
        private bool StrNumbers(string strcuscode, out string cuscode, out string codeformat, out string ordernum)
        {
            bool result = true;

            cuscode    = "";                                                     //订单代码全称
            codeformat = "";                                                     //名称,不包含流水号
            ordernum   = "";                                                     //流水号

            DataTable tbl       = GetModuleCoding();                             //自动编码
            string    txtformat = tbl.Rows[0]["txtformat"].ToString();           //名称的格式
            string    usecode   = tbl.Rows[0]["usecode"].ToString();             //是否启用
            int       len       = int.Parse(tbl.Rows[0]["orderlen"].ToString()); //流水号长度

            DataTable ordertbl = null;
            string    strsql   = ""; //查询字符窜

            if (usecode == "0")
            {
                if (strcuscode.Trim() != "")
                {
                    //strsql = "  orderNum ='" + strcuscode + "'";
                    //ordertbl = To_OrderInfoManager.getList(strsql);
                    //if (ordertbl.Rows.Count != 0)
                    //{
                    //    result = false;
                    //    Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "test", "<script>alert('保存失败, 付款单位代码已存在!')</script>");
                    //}
                    //else
                    //{
                    cuscode = strcuscode; //付款单位代码全称
                    //}
                }
                else
                {
                    result = false;
                    Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "test", "<script>alert('保存失败,付款单位代码不能为空!')</script>");
                }
            }
            else
            {
                int num = 1;                                                                                 //默认流水号
                codeformat = Numbers(txtformat);                                                             //编码规格
                LoginInfo login      = Session["login"] as LoginInfo;
                string    departcode = DepartmentInfoManager.getDepartmentInfoById(login.Departid).AutoCode; //部门自动编码标识符
                string    year       = DateTime.Parse(this.txtOutDate.Value).Year.ToString();                //出团年份
                strsql   = "  YEAR(outTime)= '" + year + "' AND LEN(codenum) =" + len.ToString() + " AND departautocode='" + departcode + "' AND orderType=" + this.DropDownList1.SelectedValue;
                ordertbl = To_OrderInfoManager.GetList(1, strsql, " id desc ");

                if (ordertbl.Rows.Count >= 1)
                {
                    if (ordertbl.Rows[0]["codenum"].ToString() != "")
                    {
                        num = int.Parse(ordertbl.Rows[0]["codenum"].ToString()) + 1; //流水号
                        if (num.ToString().Length > len)
                        {
                            result = false;
                            Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "test", "<script>alert('保存失败,流水号长度不够!')</script>");
                        }
                    }
                }
                ordernum = num.ToString().PadLeft(len, '0'); //流水号
                cuscode  = codeformat + ordernum;            //付款单位代码全称
            }
            return(result);
        }