Esempio n. 1
0
        public static List <mg_FlowlingModel> QueryFlowlingForEditing()
        {
            List <mg_FlowlingModel> list = null;
            string    sql = @"SELECT [fl_id]
                                  ,[fl_name]
                              FROM [mg_FlowLine]
                              order by fl_name";
            DataTable dt  = SqlHelper.GetDataDataTable(SqlHelper.SqlConnString, System.Data.CommandType.Text, sql, null);

            if (DataHelper.HasData(dt))
            {
                list = new List <mg_FlowlingModel>();
                foreach (DataRow row in dt.Rows)
                {
                    mg_FlowlingModel model = new mg_FlowlingModel();
                    model.fl_id   = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "fl_id"));
                    model.fl_name = DataHelper.GetCellDataToStr(row, "fl_name");
                    list.Add(model);
                }
                mg_FlowlingModel firstmodel = new mg_FlowlingModel();
                firstmodel.fl_id   = 0;
                firstmodel.fl_name = "-- 流水线(全部) --";
                list.Insert(0, firstmodel);
            }

            return(list);
        }
Esempio n. 2
0
        public static List <mg_MailModel> QueryListForPaging(string page, string pagesize, out string total)
        {
            total = "0";
            List <mg_MailModel> list = null;

            string  sql1 = @"select count(ID) total from [mg_MailConfig];";
            string  sql2 = @" 
                           SELECT top " + pagesize + @" ID mid
                                      ,ReceiptType
                                      ,case ReceiptType
                                             --when 1 then 'LineUp'
                                             --when 2 then 'Delgit'
                                            -- when 3 then '回冲' end as ReceiptTypeName
	                                    when 1 then 'LineUpTxt加载失败'
			                            when 2 then 'LineUp订单的ProductNo在MES系统中不匹配或为空'
			                            when 3 then 'DelJetTxt加载失败'
			                            when 4 then 'DelJet订单的在LineUp订单中不匹配或对应的ProductNo不匹配'
			                            when 5 then 'DelJet订单自动拆单失败'
			                            when 6 then 'SAP手动插单Txt加载失败'
			                            when 7 then 'SAP手动插单订单自动拆单失败'
			                            when 8 then 'SAP手动插单订单的ProductNo在MES系统中不匹配或为空'
			                            when 9 then 'DelJet订单的SEQNR不连续'
			                            when 10 then 'DelJet缓存文件夹写入失败' 
                                        else ''
                                       end as ReceiptTypeName
                                      ,MailRecipient
                                      ,RecipientType
                                      ,case RecipientType
                                            when 1 then '收件人'
                                            when 2 then '抄送人' end as RecipientTypeName
                                  FROM [mg_MailConfig] t1
                                     where  t1.ID not in (
                                                        select top ((" + page + @"-1)*" + pagesize + @") ID from  [mg_MailConfig] order by ID desc)
                                         order by ID desc ";
            DataSet ds   = SqlHelper.GetDataSetTableMapping(SqlHelper.SqlConnString, System.Data.CommandType.Text, sql1 + sql2, new string[] { "count", "data" }, null);

            if (DataHelper.HasData(ds))
            {
                DataTable dt1 = ds.Tables["count"];
                total = DataHelper.GetCellDataToStr(dt1.Rows[0], "total");
                DataTable dt2 = ds.Tables["data"];
                list = new List <mg_MailModel>();
                foreach (DataRow row in dt2.Rows)
                {
                    mg_MailModel model = new mg_MailModel();

                    model.mail_id           = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "mid"));
                    model.ReceiptType       = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "ReceiptType"));
                    model.ReceiptTypeName   = DataHelper.GetCellDataToStr(row, "ReceiptTypeName");
                    model.MailRecipient     = DataHelper.GetCellDataToStr(row, "MailRecipient");
                    model.RecipientType     = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "RecipientType"));
                    model.RecipientTypeName = DataHelper.GetCellDataToStr(row, "RecipientTypeName");



                    list.Add(model);
                }
            }
            return(list);
        }
Esempio n. 3
0
        public static DataTable getTableExcel(int PageSize, int pageIndex, int StartIndex, int EndIndex, string SortFlag, string sortOrder, string wherestr, out int total)
        {
            if (string.IsNullOrEmpty(SortFlag))
            {
                SortFlag = "ID";
            }
            if (string.IsNullOrEmpty(sortOrder))
            {
                sortOrder = "asc";
            }
            StringBuilder commandText = new StringBuilder();

            commandText.Append("SELECT * FROM mg_Report_FTT  where 1=1 ");
            commandText.Append(wherestr);//这里修改条件语句

            string  query_sql = commandText.ToString();
            string  count_sql = "select  count(*) as total from mg_Report_FTT where 1 = 1 " + wherestr;
            DataSet ds        = SqlHelper.GetDataSetTableMapping(SqlHelper.SqlConnString, System.Data.CommandType.Text, count_sql + query_sql, new string[] { "count", "data" }, null);

            if (DataHelper.HasData(ds))
            {
                DataTable dt1 = ds.Tables["count"];
                total = NumericParse.StringToInt(DataHelper.GetCellDataToStr(dt1.Rows[0], "total"));
                DataTable dt2 = ds.Tables["data"];
                return(dt2);
            }
            else
            {
                total = 0;
                return(null);
            }
        }
Esempio n. 4
0
        public static List <mg_partModel> QueryPartForPartidList()
        {
            List <mg_partModel> list = null;

            string    sql2 = @" 
                             
                                SELECT  [part_id]           
                                      ,[part_name]                                    
                                  FROM [mg_part]
                          
                                ";
            DataTable dt   = SqlHelper.GetDataDataTable(SqlHelper.SqlConnString, System.Data.CommandType.Text, sql2, null);

            if (DataHelper.HasData(dt))
            {
                list = new List <mg_partModel>();
                foreach (DataRow row in dt.Rows)
                {
                    mg_partModel model = new mg_partModel();

                    model.part_id   = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "part_id"));
                    model.part_name = DataHelper.GetCellDataToStr(row, "part_name");
                    list.Add(model);
                }
            }
            return(list);
        }
Esempio n. 5
0
        void SavePart1()
        {
            string part_id         = Request.Params["part_id"];
            string part_no         = Request.Params["part_no"];
            string part_name       = Request.Params["part_name"];
            string part_categoryid = Request.Params["part_categoryid"];
            string part_desc       = Request.Params["part_desc"];
            string part_type       = Request.Params["part_type"];
            string FlowLine        = Request.Params["FlowLine"];
            string Product         = Request.Params["Product"];



            mg_partModel model = new mg_partModel();

            model.part_id         = NumericParse.StringToInt(part_id);
            model.part_no         = part_no;
            model.part_name       = part_name;
            model.part_categoryid = NumericParse.StringToInt(part_categoryid);
            model.part_desc       = part_desc;
            model.part_type       = NumericParse.StringToInt(part_type);
            model.pflowlineid     = NumericParse.StringToInt(FlowLine);
            model.pproductid      = NumericParse.StringToInt(Product);


            string json = mg_Part1BLL.SavePart1(model);

            Response.Write(json);
            Response.End();
        }
Esempio n. 6
0
        public static List <Mat_SupplierListModel> QuerySupplierListForEditing()
        {
            List <Mat_SupplierListModel> list = null;
            string    sql = @"SELECT TOP 1000 [ID]
                                          ,[SupplierID]
                                          ,[SupplierName]
                                          ,[WareHouseID]
                           FROM [Mat_SupplierList]
                           order by ID";
            DataTable dt  = SqlHelper.GetDataDataTable(SqlHelper.SqlConnString, System.Data.CommandType.Text, sql, null);

            if (DataHelper.HasData(dt))
            {
                list = new List <Mat_SupplierListModel>();
                foreach (DataRow row in dt.Rows)
                {
                    Mat_SupplierListModel model = new Mat_SupplierListModel();
                    model.id           = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "ID"));
                    model.supplierid   = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "SupplierID"));
                    model.suppliername = DataHelper.GetCellDataToStr(row, "SupplierName");
                    model.warehouseid  = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "WareHouseID"));
                    list.Add(model);
                }
                Mat_SupplierListModel firstmodel = new Mat_SupplierListModel();
                firstmodel.id           = 0;
                firstmodel.suppliername = "-- 请选择供应商 --";
                list.Insert(0, firstmodel);
            }

            return(list);
        }
        /// <summary>
        /// 保存颜色
        /// </summary>
        void SaveMaterialProperty()
        {
            try
            {
                string prop_id   = Request.Params["prop_id"];
                string prop_name = Request.Params["prop_name"];
                string prop_type = Request.Params["prop_type"];

                mg_MaterialPropertyModel model = new mg_MaterialPropertyModel();
                model.prop_name = prop_name;
                model.Prop_type = NumericParse.StringToInt(prop_type);
                if (!string.IsNullOrWhiteSpace(prop_id))
                {
                    model.prop_id = Convert.ToInt32(prop_id);
                }
                else
                {
                    model.prop_id = 0;
                }

                string json = mg_MaterialPropertyBLL.SaveMaterialProperty(model);
                Response.Write(json);
                Response.End();
            }
            catch (Exception ex)
            {
            }
        }
Esempio n. 8
0
    /// 修改时间:2017年6月26日
    /// 修改人:冉守旭
    void SaveOperator()
    {
        try
        {
            string op_id         = Request.Params["op_id"];
            string st_id         = Request.Params["st_id[]"]; /// 修改时间:2017年5月9日
            string op_name       = Request.Params["op_name"];
            string op_no         = Request.Params["op_no"];
            string op_sex        = Request.Params["op_sex"];
            string op_isoperator = Request.Params["op_isoperator"];
            string op_pic        = Request.Params["op_pic"];

            mg_OperatorModel model = new mg_OperatorModel();
            model.op_id = NumericParse.StringToInt(op_id);

            /// 修改开始
            string[] strArray = st_id.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); //字符串转数组
            model.st_id      = Convert.ToInt32(strArray[0]);
            model.list_st_id = st_id;
            //修改结束
            model.op_name       = op_name;
            model.op_no         = "0000000000000000000000000" + op_no;//25个0+7为工号A000001共32位
            model.op_sex        = NumericParse.StringToInt(op_sex);
            model.op_isoperator = NumericParse.StringToInt(op_isoperator);
            model.op_pic        = op_pic;
            string json = mg_OperatorBLL.SaveOperator(model);
            Response.Write(json);
            Response.End();
        }
        catch (Exception ex)
        {
        }
    }
Esempio n. 9
0
        public static List <mg_BOMTestGroupModel> QueryListForPaging(string page, string pagesize, out string total)
        {
            total = "0";
            List <mg_BOMTestGroupModel> list = null;

            string  sql1 = @"select count(ID) total from [mg_Test_Group];";
            string  sql2 = @" SELECT top " + pagesize + @" ID gid
                                      ,GroupName
                                  FROM [mg_Test_Group] 
                                    where  ID < (
                                                select top 1 ID from 
                                                        (select top ((" + page + @"-1)*" + pagesize + @") ID from  [mg_Test_Group] where ID is not null  order by ID desc )t
                                                order by  ID  )
                                  order by ID desc
                                ";
            DataSet ds   = SqlHelper.GetDataSetTableMapping(SqlHelper.SqlConnString, System.Data.CommandType.Text, sql1 + sql2, new string[] { "count", "data" }, null);

            if (DataHelper.HasData(ds))
            {
                DataTable dt1 = ds.Tables["count"];
                total = DataHelper.GetCellDataToStr(dt1.Rows[0], "total");
                DataTable dt2 = ds.Tables["data"];
                list = new List <mg_BOMTestGroupModel>();
                foreach (DataRow row in dt2.Rows)
                {
                    mg_BOMTestGroupModel model = new mg_BOMTestGroupModel();
                    model.group_id  = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "gid"));
                    model.groupname = DataHelper.GetCellDataToStr(row, "GroupName");
                    list.Add(model);
                }
            }
            return(list);
        }
Esempio n. 10
0
        public static DataTable getList(int PageSize, int StartIndex, int EndIndex, string SortFlag, string sortOrder, string wherestr, out int total)
        {
            if (string.IsNullOrEmpty(SortFlag))
            {
                SortFlag = "st_no,step_startTime";
            }
            if (string.IsNullOrEmpty(sortOrder))
            {
                sortOrder = "asc";
            }
            List <mg_sys_log> list      = new List <mg_sys_log>();
            string            query_sql = " select * from(select row_number() over(order by " + SortFlag + " " + sortOrder + " ) as rowid,report.* from View_mg_sys_log report  where 1 = 1 " + wherestr + ") as Results where rowid >=" + StartIndex + " and rowid <=" + EndIndex + " ";

            if (EndIndex == -1)
            {
                query_sql = " select * from(select row_number() over(order by " + SortFlag + " " + sortOrder + " ) as rowid,report.* from View_mg_sys_log report  where 1 = 1 " + wherestr + ") as Results where rowid >=" + StartIndex + " ";
            }

            string  count_sql = "select  count(*) as total from View_mg_sys_log where 1 = 1 " + wherestr;
            DataSet ds        = SqlHelper.GetDataSetTableMapping(SqlHelper.SqlConnString, System.Data.CommandType.Text, count_sql + query_sql, new string[] { "count", "data" }, null);

            if (DataHelper.HasData(ds))
            {
                DataTable dt1 = ds.Tables["count"];
                total = NumericParse.StringToInt(DataHelper.GetCellDataToStr(dt1.Rows[0], "total"));
                DataTable dt2 = ds.Tables["data"];
                return(dt2);
            }
            else
            {
                total = 0;
                return(null);
            }
        }
Esempio n. 11
0
        public static List <px_PanrameterModel> QueryPanrameterListForPart()
        {
            List <px_PanrameterModel> list = null;

            string    sql2 = @" 
                            SELECT [SerialID]
                                  ,[Name]
                                  ,[Number]                                
                              FROM  [px_Panrameter]             
	                          order by SerialID asc 
                                ";
            DataTable dt   = SqlHelper.GetDataDataTable(SqlHelper.SqlConnString, System.Data.CommandType.Text, sql2, null);

            if (DataHelper.HasData(dt))
            {
                DataTable dt2 = dt;
                list = new List <px_PanrameterModel>();
                foreach (DataRow row in dt2.Rows)
                {
                    px_PanrameterModel model = new px_PanrameterModel();

                    model.SerialID = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "SerialID"));
                    model.Name     = DataHelper.GetCellDataToStr(row, "Name");
                    model.Number   = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "Number"));
                    list.Add(model);
                }
            }
            return(list);
        }
Esempio n. 12
0
    void saveUser()
    {
        string user_id      = Request.Params["user_id"];
        string user_depid   = Request.Params["user_depid"];
        string user_posiid  = Request.Params["user_posiid"];
        string user_no      = Request.Params["user_no"];
        string user_name    = Request.Params["user_name"];
        string user_email   = Request.Params["user_email"];
        string user_sex     = Request.Params["user_sex"];
        string user_isAdmin = Request.Params["user_isAdmin"];
        string user_menuids = Request.Params["user_menuids"];
        string user_pwd     = Request.Params["user_pwd"];
        string user_oldno   = Request.Params["user_oldno"];

        mg_userModel model = new mg_userModel();

        model.user_id      = user_id;
        model.user_depid   = NumericParse.StringToInt(user_depid);
        model.user_posiid  = NumericParse.StringToInt(user_posiid);
        model.user_no      = user_no;
        model.user_oldno   = user_oldno;
        model.user_name    = user_name;
        model.user_pwd     = user_pwd;
        model.user_email   = user_email;
        model.user_sex     = NumericParse.StringToInt(user_sex);
        model.user_isAdmin = NumericParse.StringToInt(user_isAdmin);
        model.user_menuids = user_menuids;
        string json = mg_UserBLL.saveUser(model);

        Response.Write(json);
        Response.End();
    }
Esempio n. 13
0
        /// <summary>
        /// 修改时间:2017年5月9日,修改内容:工位信息展示只展示工位号,不展示工位说明
        /// 修改人:冉守旭
        /// </summary>
        /// <returns></returns>
        public static List <mg_stationModel> QueryStationForOperatorEditing()
        {
            List <mg_stationModel> list = null;
//            string sql = @"SELECT [st_id]
//                                  ,[st_no]
//                                  ,[st_name]
//                              FROM [mg_station] order by st_no";
            string    sql = @"SELECT [st_no],max(st_id) as st_id,max(st_mac) as st_mac 
                           FROM [mg_station] where st_mac!='' and st_mac is not null 
                           group by st_no order by st_no ";
            DataTable dt  = SqlHelper.GetDataDataTable(SqlHelper.SqlConnString, System.Data.CommandType.Text, sql, null);

            if (DataHelper.HasData(dt))
            {
                list = new List <mg_stationModel>();
                foreach (DataRow row in dt.Rows)
                {
                    mg_stationModel model = new mg_stationModel();
                    model.st_id = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "st_id"));
                    //model.st_name = DataHelper.GetCellDataToStr(row, "st_no") + " --- " + DataHelper.GetCellDataToStr(row, "st_name");
                    model.st_name = DataHelper.GetCellDataToStr(row, "st_no");
                    list.Add(model);
                }
            }
            return(list);
        }
Esempio n. 14
0
        public static List <Mg_MaterialPropertyTypeModel> QueryMaterialPropertyTypeForEditing()
        {
            List <Mg_MaterialPropertyTypeModel> list = null;
            string    sql = @"SELECT [ID]
                                  ,[Prop_Type]
                              FROM [Mg_MaterialPropertyType]
                              order by ID";
            DataTable dt  = SqlHelper.GetDataDataTable(SqlHelper.SqlConnString, System.Data.CommandType.Text, sql, null);

            if (DataHelper.HasData(dt))
            {
                list = new List <Mg_MaterialPropertyTypeModel>();
                foreach (DataRow row in dt.Rows)
                {
                    Mg_MaterialPropertyTypeModel model = new Mg_MaterialPropertyTypeModel();
                    model.ID        = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "ID"));
                    model.Prop_Type = DataHelper.GetCellDataToStr(row, "Prop_Type");
                    list.Add(model);
                }
                Mg_MaterialPropertyTypeModel firstmodel = new Mg_MaterialPropertyTypeModel();
                firstmodel.ID        = 0;
                firstmodel.Prop_Type = "-- 请选择类型 --";
                list.Insert(0, firstmodel);
            }

            return(list);
        }
Esempio n. 15
0
        public static List <px_ShowChiClientModel> Querypx_ShowChiClientListForPart()
        {
            List <px_ShowChiClientModel> list = null;

            string    sql2 = @" 
                            SELECT [SID]
                                  ,[SName]
                                  ,[ClientIP]
                                  ,[SAddTime]
                                  ,[SRole]
                                  ,[SRamark]
                              FROM  [px_ShowChiClient]             
	                          order by SID asc 
                                ";
            DataTable dt   = SqlHelper.GetDataDataTable(SqlHelper.SqlConnString, System.Data.CommandType.Text, sql2, null);

            if (DataHelper.HasData(dt))
            {
                DataTable dt2 = dt;
                list = new List <px_ShowChiClientModel>();
                foreach (DataRow row in dt2.Rows)
                {
                    px_ShowChiClientModel model = new  px_ShowChiClientModel();

                    model.SID      = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "SID"));
                    model.SName    = DataHelper.GetCellDataToStr(row, "SName");
                    model.ClientIP = DataHelper.GetCellDataToStr(row, "ClientIP");
                    model.SAddTime = DataHelper.GetCellDataToStr(row, "SAddTime");
                    model.SRole    = DataHelper.GetCellDataToStr(row, "SRole");
                    model.SRamark  = DataHelper.GetCellDataToStr(row, "SRamark");
                    list.Add(model);
                }
            }
            return(list);
        }
Esempio n. 16
0
        public static List <Mat_SupplierListModel> querySupplierForBOM(string type)
        {
            List <Mat_SupplierListModel> list = null;
            string    sql = @"SELECT [ID]
                                      ,[SupplierID]
                                      ,[SupplierName]
                                  FROM [Mat_SupplierList] where WareHouseID=" + type + " order by SupplierID";
            DataTable dt  = SqlHelper.GetDataDataTable(SqlHelper.SqlConnString, System.Data.CommandType.Text, sql, null);

            if (DataHelper.HasData(dt))
            {
                list = new List <Mat_SupplierListModel>();
                foreach (DataRow row in dt.Rows)
                {
                    Mat_SupplierListModel model = new Mat_SupplierListModel();

                    model.supplierid   = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "SupplierID"));
                    model.suppliername = DataHelper.GetCellDataToStr(row, "SupplierName");
                    list.Add(model);
                }
                Mat_SupplierListModel firstmodel = new Mat_SupplierListModel();

                firstmodel.supplierid   = 0;
                firstmodel.suppliername = "-- 请选择类型 --";
                list.Insert(0, firstmodel);
            }
            return(list);
        }
Esempio n. 17
0
        public static DataTable getTableExcel(string SortFlag, string sortOrder, string wherestr, out int total)
        {
            if (string.IsNullOrEmpty(SortFlag))
            {
                SortFlag = "ID";
            }
            if (string.IsNullOrEmpty(sortOrder))
            {
                sortOrder = "asc";
            }
            string  query_sql = "SELECT ID,订单类型,订单编码,下单时间,车型ID,车型,订单状态,前排故障历史,前排是否修复,主驾,主驾气囊,副驾,副驾气囊,[40%] 百分之40,[60%] 百分之60,[100%] 百分之100,卷收器,MainOrderID,VINNumber,回写SAP FROM ViewOrders WHERE 1=1  " + wherestr + "order by " + SortFlag + " " + sortOrder;
            string  count_sql = "select  count(*) as total from ViewOrders where 1 = 1 " + wherestr;
            DataSet ds        = SqlHelper.GetDataSetTableMapping(SqlHelper.SqlConnString, System.Data.CommandType.Text, count_sql + query_sql, new string[] { "count", "data" }, null);

            if (DataHelper.HasData(ds))
            {
                DataTable dt1 = ds.Tables["count"];
                total = NumericParse.StringToInt(DataHelper.GetCellDataToStr(dt1.Rows[0], "total"));
                DataTable resTable2 = ds.Tables["data"];
                for (int i = 0; i < resTable2.Rows.Count; i++)
                {
                    resTable2.Rows[i]["主驾"]     = "\t" + resTable2.Rows[i]["主驾"].ToString();
                    resTable2.Rows[i]["副驾"]     = "\t" + resTable2.Rows[i]["副驾"].ToString();
                    resTable2.Rows[i]["百分之40"]  = "\t" + resTable2.Rows[i]["百分之40"].ToString();
                    resTable2.Rows[i]["百分之60"]  = "\t" + resTable2.Rows[i]["百分之60"].ToString();
                    resTable2.Rows[i]["百分之100"] = "\t" + resTable2.Rows[i]["百分之100"].ToString();
                }
                return(resTable2);
            }
            else
            {
                total = 0;
                return(null);
            }
        }
Esempio n. 18
0
        public static DataTable getTable(int Pagesize, int pageIndex, int StartIndex, int EndIndex, string SortFlag, string sortOrder, string wherestr, out int total)
        {
            if (string.IsNullOrEmpty(SortFlag))
            {
                SortFlag = "ID";
            }
            if (string.IsNullOrEmpty(sortOrder))
            {
                sortOrder = "asc";
            }
            StringBuilder commandText = new StringBuilder();

            commandText.Append("SELECT TOP " + Pagesize + " ID,订单类型,订单编码,下单时间,车型ID,车型,订单状态,前排故障历史,前排是否修复,主驾,主驾气囊,副驾,副驾气囊,[40%] 百分之40,[60%] 百分之60,[100%] 百分之100,卷收器,MainOrderID,VINNumber,回写SAP FROM (SELECT ROW_NUMBER() OVER (ORDER BY " + SortFlag + "  " + sortOrder + " ) AS RowNumber,* FROM ViewOrders where 1=1  ");
            commandText.Append(wherestr);//这里修改条件语句
            commandText.Append(" ) AS T  WHERE RowNumber >= " + StartIndex + " and RowNumber <= " + EndIndex);
            string  query_sql = commandText.ToString();
            string  count_sql = "select  count(*) as total from ViewOrders where 1 = 1 " + wherestr;
            DataSet ds        = SqlHelper.GetDataSetTableMapping(SqlHelper.SqlConnString, System.Data.CommandType.Text, count_sql + query_sql, new string[] { "count", "data" }, null);

            if (DataHelper.HasData(ds))
            {
                DataTable dt1 = ds.Tables["count"];
                total = NumericParse.StringToInt(DataHelper.GetCellDataToStr(dt1.Rows[0], "total"));
                DataTable dt2 = ds.Tables["data"];
                return(dt2);
            }
            else
            {
                total = 0;
                return(null);
            }
        }
Esempio n. 19
0
        public static List <mg_BOMModel> QueryBOMForStepEditing(string part_id)
        {
            List <mg_BOMModel> list    = null;
            string             joinSre = (!string.IsNullOrEmpty(part_id) && part_id != "0") ? @" inner join [mg_part_bom_rel] pbrel on pbrel.bom_id=bom.bom_id and pbrel.part_id=" + part_id : "";
            string             sql     = @"
                            SELECT bom.[bom_id]
                                  ,[bom_PN]
                                  ,bom_desc
                              FROM [mg_BOM] bom
                                " + joinSre + @"
                              order by bom_PN,bom_desc";
            DataTable          dt      = SqlHelper.GetDataDataTable(SqlHelper.SqlConnString, System.Data.CommandType.Text, sql, null);

            if (DataHelper.HasData(dt))
            {
                list = new List <mg_BOMModel>();
                foreach (DataRow row in dt.Rows)
                {
                    mg_BOMModel model = new mg_BOMModel();
                    model.bom_id = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "bom_id"));
                    model.bom_PN = DataHelper.GetCellDataToStr(row, "bom_PN") + " | " + DataHelper.GetCellDataToStr(row, "bom_desc");
                    list.Add(model);
                }
            }

            return(list);
        }
Esempio n. 20
0
        public static List <px_InternetPrinterModel> QueryInternetPrinterListForPart()
        {
            List <px_InternetPrinterModel> list = null;

            string    sql2 = @" 
                            SELECT [IID]
                                  ,[IName]
                                  ,[PrintIP]    ,[IAddTime],[IRole],[IRamark]                             
                              FROM  [px_InternetPrinter]             
	                          order by IID asc 
                                ";
            DataTable dt   = SqlHelper.GetDataDataTable(SqlHelper.SqlConnString, System.Data.CommandType.Text, sql2, null);

            if (DataHelper.HasData(dt))
            {
                DataTable dt2 = dt;
                list = new List <px_InternetPrinterModel>();
                foreach (DataRow row in dt2.Rows)
                {
                    px_InternetPrinterModel model = new px_InternetPrinterModel();

                    model.IID      = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "IID"));
                    model.IName    = DataHelper.GetCellDataToStr(row, "IName");
                    model.PrintIP  = DataHelper.GetCellDataToStr(row, "PrintIP");
                    model.IAddTime = DataHelper.GetCellDataToStr(row, "IAddTime");
                    model.IRole    = DataHelper.GetCellDataToStr(row, "IRole");
                    model.IRamark  = DataHelper.GetCellDataToStr(row, "IRamark");
                    list.Add(model);
                }
            }
            return(list);
        }
Esempio n. 21
0
        public static List <mg_stationModel> QueryStationForStepEditing(string fl_id)
        {
            List <mg_stationModel> list = null;
            string    qsql = (!string.IsNullOrEmpty(fl_id) && fl_id != "0") ? @"  where fl_id=" + fl_id : "";
            string    sql  = @"SELECT [st_id]
                                      ,[st_no]
                                      ,[st_name]
                                  FROM [mg_station]
                                 " + qsql + @"
                                   order by st_order";
            DataTable dt   = SqlHelper.GetDataDataTable(SqlHelper.SqlConnString, System.Data.CommandType.Text, sql, null);

            if (DataHelper.HasData(dt))
            {
                list = new List <mg_stationModel>();
                foreach (DataRow row in dt.Rows)
                {
                    mg_stationModel model = new mg_stationModel();
                    model.st_id = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "st_id"));
                    model.st_no = DataHelper.GetCellDataToStr(row, "st_no") + " | " + DataHelper.GetCellDataToStr(row, "st_name");
                    list.Add(model);
                }
                mg_stationModel firstmodel = new mg_stationModel();
                firstmodel.st_id = 0;
                firstmodel.st_no = "-- 工位(全部) --";
                list.Insert(0, firstmodel);
            }

            return(list);
        }
Esempio n. 22
0
        public static List <mg_PoInspectItemModel> QueryListForPaging(string page, string pagesize, out string total)
        {
            total = "0";
            List <mg_PoInspectItemModel> list = null;

            string  sql1 = @"select count(ID) total from [mg_PointInspection_Item];";
            string  sql2 = @" SELECT top " + pagesize + @" ID pid
                                      ,PI_Item
                                      ,PI_ItemDescribe
                                  FROM [mg_PointInspection_Item]
                                    where  ID not in (
                                               select top ((" + page + @"-1)*" + pagesize + @") ID from  [mg_PointInspection_Item]
                                                            order by ID)
                                  order by ID
                                ";
            DataSet ds   = SqlHelper.GetDataSetTableMapping(SqlHelper.SqlConnString, System.Data.CommandType.Text, sql1 + sql2, new string[] { "count", "data" }, null);

            if (DataHelper.HasData(ds))
            {
                DataTable dt1 = ds.Tables["count"];
                total = DataHelper.GetCellDataToStr(dt1.Rows[0], "total");
                DataTable dt2 = ds.Tables["data"];
                list = new List <mg_PoInspectItemModel>();
                foreach (DataRow row in dt2.Rows)
                {
                    mg_PoInspectItemModel model = new mg_PoInspectItemModel();
                    model.pi_id          = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "pid"));
                    model.piitem         = DataHelper.GetCellDataToStr(row, "PI_Item");
                    model.piitemdescribe = DataHelper.GetCellDataToStr(row, "PI_ItemDescribe");
                    list.Add(model);
                }
            }
            return(list);
        }
Esempio n. 23
0
        ///陈名兴
        ///增加下拉类型
        ///
        public static List <mg_PropertyModel> QueryPropertyFlowlingForEditing(string type)
        {
            List <mg_PropertyModel> list = null;
            string    sql = @"SELECT [prop_id]
                                  ,[Prop_Type]
                                  ,[prop_name]
                              FROM [Mg_Property]
                              where [Prop_type]=" + type + " order by prop_id";
            DataTable dt  = SqlHelper.GetDataDataTable(SqlHelper.SqlConnString, System.Data.CommandType.Text, sql, null);

            if (DataHelper.HasData(dt))
            {
                list = new List <mg_PropertyModel>();
                foreach (DataRow row in dt.Rows)
                {
                    mg_PropertyModel model = new mg_PropertyModel();
                    model.prop_id   = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "prop_id"));
                    model.prop_name = DataHelper.GetCellDataToStr(row, "prop_name");
                    model.Prop_type = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "Prop_type"));
                    list.Add(model);
                }
                mg_PropertyModel firstmodel = new mg_PropertyModel();
                firstmodel.prop_id   = 0;
                firstmodel.prop_name = "-- 请选择类型 --";
                list.Insert(0, firstmodel);
            }

            return(list);
        }
Esempio n. 24
0
        void saveProduct()
        {
            string p_id            = Request.Params["p_id"];
            string ProductNo       = Request.Params["ProductNo"];
            string ProductName     = Request.Params["ProductName"];
            string ProductDesc     = Request.Params["ProductDesc"];
            string ProductType     = Request.Params["ProductType"];
            string ProductTypeName = Request.Params["ProductTypeName"];
            string IsUseing        = Request.Params["IsUseing"];

            mg_ProductModel model = new mg_ProductModel();

            model.p_id            = NumericParse.StringToInt(p_id);
            model.ProductNo       = ProductNo;
            model.ProductName     = ProductName;
            model.ProductDesc     = ProductDesc;
            model.ProductType     = NumericParse.StringToInt(ProductType);
            model.ProductTypeName = ProductTypeName;
            model.IsUseing        = NumericParse.StringToInt(IsUseing);


            string json = mg_ProductBLL.SaveProduct(model);

            Response.Write(json);
            Response.End();
        }
Esempio n. 25
0
        public static mg_OperatorModel GetOperaterForCardNO(string cardNO)
        {
            string    sql = @" SELECT [op_id]
                                  ,[op_name]
                                  ,[op_no]
                                  ,[op_pic]
                                  ,[op_mac]
                                  ,[op_isoperator]
                                  ,op.[st_id]
                                  ,st.st_no
                              FROM [mg_Operator] op
                              left join mg_station st on op.st_id = st.st_id
                            where op_no='" + cardNO.Replace("\0", "") + "' ";
            DataTable dt  = SqlHelper.GetDataDataTable(SqlHelper.SqlConnString, System.Data.CommandType.Text, sql, null);

            if (DataHelper.HasData(dt))
            {
                foreach (DataRow row in dt.Rows)
                {
                    mg_OperatorModel model = new mg_OperatorModel();
                    model.op_id         = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "op_id"));
                    model.op_isoperator = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "op_isoperator"));
                    model.op_name       = DataHelper.GetCellDataToStr(row, "op_name");
                    model.op_no         = DataHelper.GetCellDataToStr(row, "op_no");
                    model.op_pic        = DataHelper.GetCellDataToStr(row, "op_pic");
                    model.st_no         = DataHelper.GetCellDataToStr(row, "st_no");
                    model.op_mac        = DataHelper.GetCellDataToStr(row, "op_mac");
                    model.st_id         = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "st_id"));
                    return(model);
                }
            }
            return(null);
        }
Esempio n. 26
0
        public static string getList(int PageSize, int StartIndex, int EndIndex, string SortFlag, string sortOrder, string wherestr)
        {
            if (string.IsNullOrEmpty(SortFlag))
            {
                SortFlag = " st_no,step_startTime";
            }
            if (string.IsNullOrEmpty(sortOrder))
            {
                sortOrder = "asc";
            }
            List <mg_sys_log> list = new List <mg_sys_log>();
            int     total          = 0;
            string  query_sql      = " select * from(select row_number() over(order by " + SortFlag + " " + sortOrder + " ) as rowid,report.* from View_mg_sys_log report  where 1 = 1 " + wherestr + ") as Results where rowid >=" + StartIndex + " and rowid <=" + EndIndex + " ";
            string  count_sql      = "select  count(*) as total from View_mg_sys_log where 1 = 1 " + wherestr;
            DataSet ds             = SqlHelper.GetDataSetTableMapping(SqlHelper.SqlConnString, System.Data.CommandType.Text, count_sql + query_sql, new string[] { "count", "data" }, null);

            if (DataHelper.HasData(ds))
            {
                DataTable dt1 = ds.Tables["count"];
                total = NumericParse.StringToInt(DataHelper.GetCellDataToStr(dt1.Rows[0], "total"));
                DataTable dt2 = ds.Tables["data"];
                foreach (DataRow row in dt2.Rows)
                {
                    mg_sys_log model = new mg_sys_log();
                    model.sys_id          = DataHelper.GetCellDataToStr(row, "sys_id");
                    model.op_id           = DataHelper.GetCellDataToStr(row, "op_id");
                    model.op_name         = DataHelper.GetCellDataToStr(row, "op_name");
                    model.fl_id           = DataHelper.GetCellDataToStr(row, "fl_id");
                    model.fl_name         = DataHelper.GetCellDataToStr(row, "fl_name");
                    model.st_id           = DataHelper.GetCellDataToStr(row, "st_id");
                    model.st_no           = DataHelper.GetCellDataToStr(row, "st_no");
                    model.PartOrderID     = DataHelper.GetCellDataToStr(row, "PartOrderID");
                    model.or_no           = DataHelper.GetCellDataToStr(row, "or_no");
                    model.part_no         = DataHelper.GetCellDataToStr(row, "part_no");
                    model.step_order      = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "step_order"));
                    model.step_startTime  = DataHelper.GetCellDataToStr(row, "step_startTime");
                    model.step_endTime    = DataHelper.GetCellDataToStr(row, "step_endTime");
                    model.step_duringtime = DataHelper.GetCellDataToStr(row, "step_duringtime");
                    model.AngleResult     = DataHelper.GetCellDataToStr(row, "AngleResult");
                    model.TorqueResult    = DataHelper.GetCellDataToStr(row, "TorqueResult");
                    model.scanCode        = DataHelper.GetCellDataToStr(row, "scanCode");
                    model.scanResult      = DataHelper.GetCellDataToStr(row, "scanResult");
                    model.sys_desc        = DataHelper.GetCellDataToStr(row, "sys_desc");
                    model.ScrewCount      = DataHelper.GetCellDataToStr(row, "ScrewCount");
                    model.MenderName      = DataHelper.GetCellDataToStr(row, "MenderName");
                    model.ReviseTime      = DataHelper.GetCellDataToStr(row, "ReviseTime");


                    list.Add(model);
                }
            }
            DataListModel <mg_sys_log> allmodel = new DataListModel <mg_sys_log>();

            allmodel.total = total.ToString();
            allmodel.rows  = list;
            string jsonStr = JSONTools.ScriptSerialize <DataListModel <mg_sys_log> >(allmodel);

            return(jsonStr);
        }
Esempio n. 27
0
        public static List <mg_allpartModel> QueryListForPaging(string page, string pagesize, out string total)
        {
            total = "0";
            List <mg_allpartModel> list = null;

            string  sql1 = @"select count(all_id) total from [mg_allpart];";
            string  sql2 = @" 
                            SELECT top " + pagesize + @" [all_id]
                                  ,[all_no]
                                  ,[all_rateid]
                                  ,r.prop_name [all_ratename]
                                  ,[all_colorid]
                                  ,c.prop_name [all_colorname]
                                  ,[all_metaid]
                                  ,m.prop_name [all_metaname]
                                  ,[all_desc]
                              FROM  [mg_allpart] a
                              left join mg_Property r on a.all_rateid=r.prop_id
                              left join mg_Property c on a.all_colorid=c.prop_id
                              left join mg_Property m on a.all_metaid=m.prop_id
                                where  a.all_id < (
                                                select top 1 all_id from 
                                                        (select top ((" + page + @"-1)*" + pagesize + @") all_id from  [mg_allpart] where all_id is not null  order by all_id desc )t
                                                order by  all_id  )
                                
	                            order by a.all_id desc

                                ";
            DataSet ds   = SqlHelper.GetDataSetTableMapping(SqlHelper.SqlConnString, System.Data.CommandType.Text, sql1 + sql2, new string[] { "count", "data" }, null);

            if (DataHelper.HasData(ds))
            {
                DataTable dt1 = ds.Tables["count"];
                total = DataHelper.GetCellDataToStr(dt1.Rows[0], "total");
                DataTable dt2 = ds.Tables["data"];
                list = new List <mg_allpartModel>();
                foreach (DataRow row in dt2.Rows)
                {
                    mg_allpartModel model = new mg_allpartModel();

                    model.all_id        = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "all_id"));
                    model.all_no        = DataHelper.GetCellDataToStr(row, "all_no");
                    model.all_rateid    = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "all_rateid"));
                    model.all_ratename  = DataHelper.GetCellDataToStr(row, "all_ratename");
                    model.all_colorid   = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "all_colorid"));
                    model.all_colorname = DataHelper.GetCellDataToStr(row, "all_colorname");
                    model.all_metaid    = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "all_metaid"));
                    model.all_metaname  = DataHelper.GetCellDataToStr(row, "all_metaname");
                    model.all_desc      = DataHelper.GetCellDataToStr(row, "all_desc");

                    list.Add(model);
                }
            }
            return(list);
        }
Esempio n. 28
0
        public static List <mg_partModel> QueryListForPaging(string page, string pagesize, out string total)
        {
            total = "0";
            List <mg_partModel> list = null;

            string  sql1 = @"select count(part_id) total from [mg_part];";
            string  sql2 = @" 
                            with data as 
                                  (
	                                 select allp.all_id,allp.all_no,aprel.partid_id from [mg_allpart_part_rel] aprel left join [mg_allpart] allp on aprel.all_id=allp.all_id
	                                 )
                                SELECT top " + pagesize + @" [part_id]
                                      ,[part_no]
                                      ,[part_name]
                                      ,[part_desc]
                                      ,[part_categoryid]
                                      ,prop.prop_name [part_Category]
	                                  ,STUFF((SELECT ','+cast (all_id as varchar) from data allp where allp.partid_id=p.part_id  for xml path('')),1,1,'')allpartIDs
	                                  ,STUFF((SELECT ','+cast (all_no as varchar) from data allp where allp.partid_id=p.part_id  for xml path('')),1,1,'')allpartNOs
                                  FROM [mg_part] p
                                  left join mg_Property prop on p.part_categoryid = prop.prop_id
                                     where  p.part_id < (
                                                select top 1 part_id from 
                                                        (select top ((" + page + @"-1)*" + pagesize + @") part_id from  [mg_part] where part_id is not null  order by part_id desc )t
                                                order by  part_id  )
                                
                                order by part_id desc
                                ";
            DataSet ds   = SqlHelper.GetDataSetTableMapping(SqlHelper.SqlConnString, System.Data.CommandType.Text, sql1 + sql2, new string[] { "count", "data" }, null);

            if (DataHelper.HasData(ds))
            {
                DataTable dt1 = ds.Tables["count"];
                total = DataHelper.GetCellDataToStr(dt1.Rows[0], "total");
                DataTable dt2 = ds.Tables["data"];
                list = new List <mg_partModel>();
                foreach (DataRow row in dt2.Rows)
                {
                    mg_partModel model = new mg_partModel();

                    model.part_id         = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "part_id"));
                    model.part_no         = DataHelper.GetCellDataToStr(row, "part_no");
                    model.part_name       = DataHelper.GetCellDataToStr(row, "part_name");
                    model.part_desc       = DataHelper.GetCellDataToStr(row, "part_desc");
                    model.part_categoryid = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "part_categoryid"));
                    model.part_Category   = DataHelper.GetCellDataToStr(row, "part_Category");
                    model.allpartIDs      = DataHelper.GetCellDataToStr(row, "allpartIDs");
                    model.allpartNOs      = DataHelper.GetCellDataToStr(row, "allpartNOs");

                    list.Add(model);
                }
            }
            return(list);
        }
Esempio n. 29
0
    void SaveBOM()
    {
        string bom_id           = Request.Params["bom_id"];
        string bom_PN           = Request.Params["bom_PN"];
        string bom_customerPN   = Request.Params["bom_customerPN"];
        string bom_isCustomerPN = Request.Params["bom_isCustomerPN"];
        string bom_picture      = Request.Params["bom_picture"];
        string bom_weight       = Request.Params["bom_weight"];
        string bom_leve         = Request.Params["bom_leve"];
        string bom_colorid      = Request.Params["bom_colorid"];
        string bom_materialid   = Request.Params["bom_materialid"];
        string bom_categoryid   = Request.Params["bom_categoryid"];
        string bom_prop         = Request.Params["bom_prop"];
        string bom_storeid      = Request.Params["bom_storeid"];
        string bom_suppllerid   = Request.Params["bom_suppllerid"];
        string bom_profile      = Request.Params["bom_profile"];
        string bom_descCH       = Request.Params["bom_descCH"];
        string bom_desc         = Request.Params["bom_desc"];
        string partIDs          = Request.Params["partIDs"];
        string barcode_start    = Request.Params["barcode_start"];
        string barcode_number   = Request.Params["barcode_number"];

        mg_BOMModel model = new mg_BOMModel();

        model.bom_id           = NumericParse.StringToInt(bom_id);
        model.bom_PN           = bom_PN;
        model.bom_customerPN   = bom_customerPN;
        model.bom_isCustomerPN = NumericParse.StringToInt(bom_isCustomerPN);
        model.bom_picture      = bom_picture;
        model.bom_weight       = NumericParse.StringToInt(bom_weight);
        model.bom_leve         = NumericParse.StringToInt(bom_leve);
        model.bom_colorid      = NumericParse.StringToInt(bom_colorid);
        model.bom_materialid   = NumericParse.StringToInt(bom_materialid);
        model.bom_categoryid   = NumericParse.StringToInt(bom_categoryid);
        model.bom_storeid      = NumericParse.StringToInt(bom_storeid);
        //  model.bom_prop = NumericParse.StringToInt(bom_prop);
        model.bom_suppllerid = NumericParse.StringToInt(bom_suppllerid);
        model.bom_profile    = bom_profile;
        model.bom_descCH     = bom_descCH;
        model.bom_desc       = bom_desc;
        model.partIDs        = partIDs;
        model.barcode_start  = NumericParse.StringToInt(barcode_start);
        model.barcode_number = NumericParse.StringToInt(barcode_number);

        string json = mg_BomBLL.SaveBOM(model);

        Response.Write(json);
        Response.End();
    }
Esempio n. 30
0
        public static List <px_PrintModel> Querypx_PrintList()
        {
            List <px_PrintModel> list = null;

            string    sql2 = @" 
                            SELECT [id]
                                  ,[PXID]
                                  ,[orderid]
                                  ,[cartype]
                                  ,[XF]
                                  ,[LingjianHao]
                                  ,[sum]
                                  ,[ordername]
                                  ,[dayintime]
                                  ,[printpxid]
                                  ,[resultljh]
                                  ,[isauto]
                                  ,[SFlag]
                              FROM  [px_Print]             
	                          order by id asc 
                                ";
            DataTable dt   = SqlHelper.GetDataDataTable(SqlHelper.SqlConnString, System.Data.CommandType.Text, sql2, null);

            if (DataHelper.HasData(dt))
            {
                DataTable dt2 = dt;
                list = new List <px_PrintModel>();
                foreach (DataRow row in dt2.Rows)
                {
                    px_PrintModel model = new px_PrintModel();

                    model.id          = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "id"));
                    model.isauto      = DataHelper.GetCellDataToStr(row, "isauto");
                    model.PXID        = DataHelper.GetCellDataToStr(row, "PXID");
                    model.orderid     = DataHelper.GetCellDataToStr(row, "orderid");
                    model.cartype     = DataHelper.GetCellDataToStr(row, "cartype");
                    model.XF          = DataHelper.GetCellDataToStr(row, "XF");
                    model.sum         = DataHelper.GetCellDataToStr(row, "sum");
                    model.ordername   = DataHelper.GetCellDataToStr(row, "ordername");
                    model.LingjianHao = DataHelper.GetCellDataToStr(row, "LingjianHao");
                    model.dayintime   = NumericParse.StringToDateTime(DataHelper.GetCellDataToStr(row, "dayintime"));
                    model.printpxid   = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "printpxid"));
                    model.resultljh   = DataHelper.GetCellDataToStr(row, "resultljh");
                    model.SFlag       = DataHelper.GetCellDataToStr(row, "SFlag");
                    list.Add(model);
                }
            }
            return(list);
        }