Beispiel #1
0
        public override string ToString()
        {
            string strsql = "select '['+ZhuangKuangCode+']'+ZhuangKuangName as showName from ZiChan_ShiYongZhuangKuang where ZhuangKuangCode='" + this.ZhuangKuangCode + "'";
            object objRel = server.ExecuteScalar(strsql);

            return(objRel == null ? "" : objRel.ToString());
        }
Beispiel #2
0
        /// <summary>
        /// 验证model的合法性
        /// </summary>
        /// <returns></returns>
        private bool AuditModel(T_RebatesStandard model, out string msg)
        {
            msg = "";
            bool flg = true;

            if (model.ControlItemCode == "Qcfp")
            {
                flg = true;
            }
            else
            {
                string strsql = @"select count(*) from dbo.T_RebatesStandard where (('" + model.EffectiveDateFrm + "'>=EffectiveDateFrm and '" + model.EffectiveDateFrm + "'<=EffectiveDateTo) or ('" + model.EffectiveDateTo + "'<= EffectiveDateTo and '" + model.EffectiveDateTo +
                                "'>=EffectiveDateFrm ) )and  TruckTypeCode='" + model.TruckTypeCode + "' and DeptCode='" + model.DeptCode + "' and SaleFeeTypeCode='" + model.SaleFeeTypeCode + "' and ControlItemCode='" + model.ControlItemCode
                                + "' and ((" + model.SaleCountFrm + ">=SaleCountFrm and " + model.SaleCountFrm +
                                "<=SaleCountTo )or (" + model.SaleCountTo + "<=SaleCountTo and " + model.SaleCountTo + ">=SaleCountFrm))";
                int ierx = int.Parse(server.ExecuteScalar(strsql).ToString());
                if (ierx > 0)
                {
                    msg = "该返利标准与数据库中已存在的标准存在交集,请重新设定!";
                    flg = false;
                }
            }


            return(flg);
        }
Beispiel #3
0
        public override string ToString()
        {
            string strsql = "select '['+LeibieCode+']'+LeibieName as showName from ZiChan_Leibie where LeibieCode='" + this.LeibieCode + "'";
            object objRel = server.ExecuteScalar(strsql);

            return(objRel == null ? "" : objRel.ToString());
        }
Beispiel #4
0
        /// <summary>
        /// 根据车架号获取车辆类型
        /// </summary>
        /// <returns></returns>
        public string GetTruckTypeByCode(string StrCarcode)
        {
            string strsql = @"select top 1 cxh as cartypename  from V_TruckMsg where cjh='" + StrCarcode + "'";
            object obj    = server.ExecuteScalar(strsql);

            return(obj == null ? "" : obj.ToString());
            //DataSet ds = server.GetDataSet(strsql);
            //StringBuilder arry = new StringBuilder();
            //foreach (DataRow dr in ds.Tables[0].Rows)
            //{
            //    arry.Append("'");
            //    arry.Append(Convert.ToString(dr["cartypename"]));
            //    arry.Append("',");
            //}
            //if (arry.Length > 1)
            //{
            //    string script = arry.ToString().Substring(0, arry.Length - 1);
            //    return script;
            //}
            //else
            //{
            //    return "";
            //}
        }