Example #1
0
        /// <summary>
        /// 由folder获取附件信息
        /// </summary>
        /// <param name="folder"></param>
        /// <returns></returns>
        public ActionResult GetListByFolder(string folder)
        {
            string sql = "select * from Sys_Attachment where folder ='" + folder + "'";

            System.Data.DataTable dt = SxSqlHelperBLL.FindTable(sql);
            return(ToJsonResult(dt));
        }
Example #2
0
        /// <summary>
        /// 获取所有供应商
        /// </summary>
        /// <returns></returns>
        public ActionResult getSuppliser()
        {
            string    sql = "select spuCode as supCode,spuName as supName from dbo.Sys_Supplier";
            DataTable dt  = SxSqlHelperBLL.FindTable(sql);

            return(ToJsonResult(dt));
        }
Example #3
0
        /// <summary>
        /// 获取原材料信息 合金、状态、配料类型
        /// </summary>
        /// <returns></returns>
        public ActionResult getYuanCaiLiaoInfo()
        {
            string    sql1 = "select cinvCode from dbo.Sys_Materiel where cinvClassCode='YCL002'";
            string    sql2 = @"select ItemValue from dbo.Base_DataItemDetail 
                            where ItemId in(select itemid from base_dataitem where itemcode = 'YCLState')";
            string    sql3 = "select cinvCode from dbo.Sys_Materiel where cinvClassCode='PM100'";
            DataTable dt1  = SxSqlHelperBLL.FindTable(sql1);
            DataTable dt2  = SxSqlHelperBLL.FindTable(sql2);
            DataTable dt3  = SxSqlHelperBLL.FindTable(sql3);
            var       json = new { hejin = dt1, state = dt2, plsort = dt3 };

            return(ToJsonResult(json));
        }
Example #4
0
        /// <summary>
        /// 打印获取数据信息 测试
        /// </summary>
        public ActionResult getPrintDataBak(string tplname, string dataid, string datasort)
        {
            //模板提取
            string    tpl = "";
            DataTable dt  = SxSqlHelperBLL.FindTable("select top 1 con from dbo.MES_PrintTpl where name='" + Server.UrlDecode(tplname) + "'");

            if (dt.Rows.Count > 0)
            {
                tpl = dt.Rows[0][0].ToString();
            }
            //标签提取
            DataTable dtImgFlag = SxSqlHelperBLL.FindTable("select name,value from dbo.MES_PrintFlag where sort='图片标签'");
            //前台解析json数据格式要求:
            // { a:'',b:'',c:[{d:'',e:'',f:''},{d:'',e:'',f:''}]}

            // 或者:{DAN:[{}],H:[],G:[]},DAN只解析为单数据,
            //a,b 为单数据调用方式:{{a}},
            //c:行数据,调用第一行数据方式:{{c1.d}},
            //
            DataTable danData  = null; //单数据
            DataTable hangData = null; //行数据

            //包承重
            if (datasort.ToLower() == "baochengzhong")
            {
                string sql = "select * from print_BaoZhuang_Juan where id='" + dataid + "'";
                danData = SxSqlHelperBLL.FindTable(sql);
            }
            //箱打印
            else if (datasort.ToLower() == "xiangbiaoqian")
            {
                //箱信息 单数据
                string sql = "select * from  print_BaoZhuang_Xiang  where xID='" + dataid + "'";
                danData = SxSqlHelperBLL.FindTable(sql);
                //卷信息 行数据
                string sql1 = "select * from  print_BaoZhuang_Juan  where xid='" + dataid + "'";
                hangData = SxSqlHelperBLL.FindTable(sql1);
            }
            ReData data = new Controllers.ReData();

            data.DAN = danData;
            data.H   = hangData;
            //返回json数据,
            var re = new { tpl = tpl, data = data, imgflag = dtImgFlag };

            return(ToJsonResult(re));
        }
Example #5
0
        public ActionResult SaveForm(string keyValue, CreditWriteEntity entity)
        {
            int iyear = entity.iYear.ToInt();

            if (iyear <= 0)
            {
                return(Error("年度录入不正确"));
            }
            string sql = "select id from CR_CreditWrite where userID='" + entity.userID + "' and iYear='" + iyear + "' ";

            if (keyValue.ToStringV() != Str.Empty)
            {
                sql += " and id!='" + keyValue + "'";
            }
            DataTable tt = SxSqlHelperBLL.FindTable(sql);

            if (TB.CheckTB(tt))
            {
                return(Error("用户[" + entity.userName + "]年度[" + iyear.ToString() + "]信息已经存在,不能重复录入"));
            }
            creditwritebll.SaveForm(keyValue, entity);
            return(Success("操作成功。"));
        }
Example #6
0
        /// <summary>
        /// 打印获取数据信息-卷信息
        /// </summary>
        public ActionResult getPrintData_Juan(string dataids)
        {
            List <Object> listResult = new List <object>();                          //实体结果
            List <string> listIDs    = Str.FormStringV(dataids, new char[] { ',' }); //ID集合
            List <string> listError  = new List <string>();                          //错误信息

            if (listIDs.Count <= 0)
            {
                return(Error("没有获取重量ID信息."));
            }
            //图片标签 提取
            DataTable dtImgFlag = SxSqlHelperBLL.FindTable("select name,value from  MES_PrintFlag where sort='图片标签'");

            DataTable danData = null;//单数据

            //DataTable hangData = null;//行数据

            foreach (var curID in listIDs)
            {
                //包承重-卷信息数据源
                string sql = "select * from print_BaoZhuang_Juan where id='" + curID + "'";
                danData = SxSqlHelperBLL.FindTable(sql);
                if (danData == null || danData.Rows.Count <= 0)
                {
                    listError.Add("称重信息ID:" + curID + " 不存在,请重试");
                }

                string biaoQian_Juan = danData.Rows[0]["biaoQian_Juan"].ToStringV();
                if (string.IsNullOrEmpty(biaoQian_Juan))
                {
                    listError.Add("称重信息ID:" + curID + " 没有标签信息,请在包装界面维护.");
                }
                //模板提取 biaoQian_Juan
                string    tpl = Str.Empty;
                DataTable dt  = SxSqlHelperBLL.FindTable("select top 1 con from dbo.MES_PrintTpl where name='" + biaoQian_Juan + "'");
                if (dt.Rows.Count > 0)
                {
                    tpl = dt.Rows[0][0].ToString();
                }
                if (string.IsNullOrEmpty(tpl))
                {
                    listError.Add("称重信息ID:" + curID + " 没有标签名称:" + biaoQian_Juan + ",请在标签界面维护.");
                }
                ReData data = new Controllers.ReData();
                data.DAN = danData;
                //data.H = hangData;
                //返回json数据,
                var re = new { type = ResultType.success, message = "OK", tpl = tpl, data = data, imgflag = dtImgFlag };
                listResult.Add(re);
            }
            if (listError.Count > 0)
            {
                //操作失败信息
                string err = string.Empty;
                foreach (var strError in listError)
                {
                    err += strError + "\r\n";
                }
                return(Error(err));
            }
            else
            {
                //操作成功返回结果集合
                return(ToJsonResult(listResult));
            }
        }