Exemplo n.º 1
0
        public List <wrench> select()
        {
            List <wrench> wrechlist = new List <wrench>();

            ServerHelp.findList <wrench>(out wrechlist, _webip);
            return(wrechlist);
        }
Exemplo n.º 2
0
        public void ProcessRequest(HttpContext context)
        {
            //执形对应服务的方法
            ServerDescription serverTypeDescription = ServerHelp.GetServiceController(this.currentServerActionPair.Server);

            if (serverTypeDescription == null)
            {
                ExceptionHelper.Throw404Exception(context);
            }
            //服务对应的Type
            Type type = serverTypeDescription.ServerType;
            //得到方法
            MethodInfo method = type.GetMethod(this.currentServerActionPair.Action,
                                               BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance);

            if (method == null)
            {
                ExceptionHelper.Throw404Exception(context);
            }
            List <object> parameters = new List <object>();

            foreach (ParameterInfo parameter in method.GetParameters())
            {
                parameters.Add(this._modelBinder.BindModel(parameter.Name, parameter.ParameterType));
            }

            object obj = Activator.CreateInstance(type);

            object content = method.Invoke(obj, parameters.ToArray());

            context.Response.ContentType = "text/plain";
            context.Response.Write(content);
        }
Exemplo n.º 3
0
        public List <Model.errorrangset> select()
        {
            List <errorrangset> el = new List <errorrangset> ();

            ServerHelp.findList <errorrangset>(out el, _webip);
            return(el);
        }
Exemplo n.º 4
0
        public List <Model.department> Select()
        {
            List <Model.department> dep = new List <Model.department>();

            ServerHelp.findList <Model.department>(out dep, _webIp);
            return(dep);
        }
Exemplo n.º 5
0
        public List <Model.UserToRoleModel.usertorole> select()
        {
            List <QDDL.Model.UserToRoleModel.usertorole> url = new List <Model.UserToRoleModel.usertorole>();

            ServerHelp.findList(out url, _webip);
            return(url);
        }
Exemplo n.º 6
0
        public List <wrenchspecies> select()
        {
            List <wrenchspecies> wp = new List <wrenchspecies> ();

            ServerHelp.findList <wrenchspecies>(out wp, _webip);
            return(wp);
        }
Exemplo n.º 7
0
        public List <Model.wrenchstatus> selectAll()
        {
            List <wrenchstatus> wrenchstatuslist = new List <wrenchstatus> ();

            ServerHelp.findList <wrenchstatus>(out wrenchstatuslist, _webip);
            return(wrenchstatuslist);
        }
Exemplo n.º 8
0
        public List <role> Select()
        {
            List <role> rolelist = new List <role>();

            ServerHelp.findList <role>(out rolelist, _webip);
            return(rolelist);
        }
Exemplo n.º 9
0
        public List <Model.duties> Select()
        {
            List <duties> dl = new List <duties>();

            ServerHelp.findList <duties>(out dl, _webip);
            return(dl);
        }
Exemplo n.º 10
0
        public List <users> Select()
        {
            List <Model.users> userlist = new List <Model.users>();

            ServerHelp.findList <Model.users>(out userlist, _webserviceip);
            return(userlist);
        }
Exemplo n.º 11
0
        public List <torquechecktarget> SelectByDate(DateTime first, DateTime last, string wrenchID)
        {
            //DateTime start=dt;
            //DateTime last=dt.AddDays (1).AddMilliseconds (-1);
            string condition = string.Format("checkDate>='{0}' and checkDate<='{1}' and wrenchID_id='{2}'", first, last, wrenchID);

            return(ServerHelp.findDataByCondition <torquechecktarget>(condition, _webip));
        }
Exemplo n.º 12
0
        public bool Update(Model.torquechecktarget torquechecktarget)
        {
            string tableName = typeof(torquechecktarget).Name;
            string contion   = string.Format("guid='{0}'", torquechecktarget.guid);
            string sql       = string.Format("wrenchID_id='{0}',checkDate='{1}',qaID='{2}',operatorID='{3}',torqueTargetValue='{4}',errorRangeMax='{5}',is_good='{6}',comment='{7}',errorRangeMin='{8}'", torquechecktarget.wrenchID, Convert.ToDateTime(torquechecktarget.checkDate), torquechecktarget.qaID, torquechecktarget.operatorID, torquechecktarget.torqueTargetValue, torquechecktarget.errorRangeMax, torquechecktarget.is_good?1:0, torquechecktarget.comment, torquechecktarget.errorRangeMin);

            return(ServerHelp.updateByWhere(tableName, _webip, contion, sql));
        }
Exemplo n.º 13
0
        public bool update(Model.wrenchstatus wrenchstatusmodel)
        {
            string tableName = typeof(wrenchstatus).Name;
            string contion   = string.Format("guid='{0}'", wrenchstatusmodel.guid);
            string sql       = string.Format("statusName='{0}',statusDM='{1}',comment='{2}'", wrenchstatusmodel.statusName, wrenchstatusmodel.statusDM, wrenchstatusmodel.comment);

            return(ServerHelp.updateByWhere(tableName, _webip, contion, sql));
        }
Exemplo n.º 14
0
        public bool update(Model.UserToRoleModel.usertorole usertorolemodel)
        {
            string sql       = string.Format("role_id='{0}'", usertorolemodel.role);
            string contion   = string.Format("user_id='{0}'", usertorolemodel.user);
            string tablename = typeof(QDDL.Model.UserToRoleModel.usertorole).Name;

            return(ServerHelp.updateByWhere(tablename, _webip, contion, sql));
        }
Exemplo n.º 15
0
        public bool Update(Model.duties duty)
        {
            string tableName = typeof(duties).Name;
            string contion   = string.Format("guid='{0}'", duty.guid);
            string sql       = string.Format("department_id='{0}',dutiesName='{1}',comment='{2}'", duty.department, duty.dutiesName, duty.comment);

            return(ServerHelp.updateByWhere(tableName, _webip, contion, sql));
        }
Exemplo n.º 16
0
        public bool update(Model.borrowrecord borrowrecordmodel)
        {
            string tablename = typeof(borrowrecord).Name;
            string contion   = string.Format("guid='{0}'", borrowrecordmodel.guid);
            string strsql    = string.Format("WrenchID_id='{0}',returnDate='{1}',returnOperator='{2}',returnUser='******',is_return='{4}',comment='{5}'", borrowrecordmodel.WrenchID, borrowrecordmodel.returnDate = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), borrowrecordmodel.returnOperator, borrowrecordmodel.returnUser, borrowrecordmodel.is_return ?1:0, borrowrecordmodel.comment);

            return(ServerHelp.updateByWhere(tablename, _webip, contion, strsql));
        }
Exemplo n.º 17
0
        public bool update(Model.errorrangset errorrangsetmodel)
        {
            string tableName = typeof(errorrangset).Name;
            string sql       = string.Format("id='{0}',speciesID='{1}',rangmax='{2}',rangmin='{3}',unit='{4}',errorrangMax='{5}',comment='{6}',errorrangMin='{7}'", errorrangsetmodel.id, errorrangsetmodel.speciesID, errorrangsetmodel.rangmax, errorrangsetmodel.rangmin, errorrangsetmodel.unit, errorrangsetmodel.errorrangMax, errorrangsetmodel.comment, errorrangsetmodel.errorrangMin);
            string contion   = string.Format("id='{0}'", errorrangsetmodel.id);

            return(ServerHelp.updateByWhere(tableName, _webip, contion, sql));
        }
Exemplo n.º 18
0
        public bool update(Model.systemcheckset systemchecksetmodel)
        {
            string contion   = string.Format("systemname='{0}'", systemchecksetmodel.systemname);
            string sql       = string.Format("id='{0}',count='{1}',arry='{2}',boundaryvalue='{3}',throwvalue='{4}',comment='{5}'", systemchecksetmodel.id, systemchecksetmodel.count, systemchecksetmodel.arry, systemchecksetmodel.boundaryvalue, systemchecksetmodel.throwvalue, systemchecksetmodel.comment);
            string tablename = typeof(systemcheckset).Name;

            return(ServerHelp.updateByWhere(tablename, _webip, contion, sql));
        }
Exemplo n.º 19
0
        public bool updata(Model.wrenchspecies species)
        {
            string tableName = typeof(wrenchspecies).Name;
            string sql       = string.Format("speciesName='{0}',speciesCode='{1}',parentSpecies='{3}',comment='{2}'", species.speciesName, species.speciesCode, species.comment, species.parentSpecies);
            string contion   = string.Format("guid='{0}'", species.guid);

            return(ServerHelp.updateByWhere(tableName, _webip, contion, sql));
        }
Exemplo n.º 20
0
        public bool Update(borrow borrowmodel)
        {
            string tablename = typeof(borrow).Name;
            string strsql    = string.Format("WrenchID_id='{0}',borrowUser='******',borrowOperator='{2}',returnUser='******',returnOperator='{4}',borrowDate='{5}',returnDate='{6}',comment='{7}',is_return={8}", borrowmodel.WrenchID, borrowmodel.borrowUser, borrowmodel.borrowOperator, borrowmodel.returnUser, borrowmodel.returnOperator, borrowmodel.borrowDate, borrowmodel.returnDate, borrowmodel.comment, borrowmodel.is_return);
            string contation = string.Format("guid='{0}'", borrowmodel.guid);

            return(ServerHelp.updateByWhere(tablename, _webip, contation, strsql));
        }
Exemplo n.º 21
0
        public bool Update(Model.department departmentmodel)
        {
            string tableName = typeof(department).Name;
            string contion   = string.Format("guid='{0}'", departmentmodel.guid);
            string sql       = string.Format("departmentName='{0}',parentDepartment='{1}',comment='{2}',delDepartment={3}", departmentmodel.departmentName, departmentmodel.parentDepartment, departmentmodel.comment, departmentmodel.delDepartment);

            return(ServerHelp.updateByWhere(tableName, _webIp, contion, sql));
        }
Exemplo n.º 22
0
 public Model.wrench selectByBarcode(string barcode)
 {
     try
     {
         string contion = string.Format("wrenchBarCode='{0}'", barcode);
         return(ServerHelp.findDataByCondition <wrench>(contion, _webip).FirstOrDefault());
     }
     catch { return(new wrench()); }
 }
Exemplo n.º 23
0
        public bool Update(role userrole)
        {
            // return ServerHelp.updateSingleInfo<role>(userrole.id ,userrole ,_webip );
            string tbname  = typeof(role).Name;
            string contion = string.Format("guid='{0}'", userrole.guid);
            string strsql  = string.Format("roleName='{0}',system_id='{1}',roleDM='{2}',comment='{3}' ", userrole.roleName, userrole.system, userrole.roleDM, userrole.comment);

            return(ServerHelp.updateByWhere(tbname, _webip, contion, strsql));
        }
Exemplo n.º 24
0
        public int SelectCount()
        {
            string condition = "";

            return(ServerHelp.findListWhereCount(condition, _webip, typeof(wrench).Name));


            //  return Convert.ToInt16(ServerHelp.findDataByContion<int>(condition, "", _webip, typeof(wrench).Name).FirstOrDefault());
        }
Exemplo n.º 25
0
        public bool Update(users user)
        {
            string tablename = typeof(users).Name;

            string strsql    = string.Format("username='******',password='******',is_staff={2},empID='{3}',cardID='{4}',phoneNumber='{5}',IDNum='{6}',mail='{7}',department_id='{8}',comment='{9}',is_superuser={10},duties_id='{11}'", user.username, user.password, user.is_staff, user.empID, user.cardID, user.phoneNumber, user.IDNum, user.mail, user.department, user.comment, user.is_superuser, user.duties);
            string contation = string.Format("guid='{0}'", user.guid);

            return(ServerHelp.updateByWhere(tablename, _webserviceip, contation, strsql));
        }
Exemplo n.º 26
0
        public bool updata(Model.wrench wrenchtool)
        {
            string tablename = typeof(wrench).Name;
            string contion   = string.Format("guid='{0}'", wrenchtool.guid);
            string updatestr = string.Format(
                "wrenchCode='{0}',wrenchBarCode='{1}',rangeMin='{2}',rangeMax='{3}',factory='{4}',species_id='{5}',status_id='{6}',comment='{7}',targetvalue='{8}',unit='{9}',isallowcheck={10},cycletime={11},createDate='{12}' , targetvalue1='{13}',targetvalue2='{14}' , lastrepair='{15}'", wrenchtool.wrenchCode
                , wrenchtool.wrenchBarCode, wrenchtool.rangeMin, wrenchtool.rangeMax, wrenchtool.factory, wrenchtool.species, wrenchtool.status, wrenchtool.comment, wrenchtool.targetvalue, wrenchtool.unit, wrenchtool.isallowcheck, wrenchtool.cycletime, wrenchtool.createDate, wrenchtool.targetvalue1, wrenchtool.targetvalue2, wrenchtool.lastrepair);

            return(ServerHelp.updateByWhere(tablename, _webip, contion, updatestr));
        }
Exemplo n.º 27
0
        public duties SelectByGuid(string guid)
        {
            string        contion = string.Format("guid='{0}'", guid);
            List <duties> duty    = new List <duties>();

            duty = ServerHelp.findDataByCondition <duties>(contion, _webip);
            if (duty.Count > 0)
            {
                return(duty.FirstOrDefault());
            }
            return(new duties());
        }
Exemplo n.º 28
0
        public List <wrench> selectByContion(Dictionary <string, string> dict)
        {
            string str = "";

            foreach (var d in dict)
            {
                str += (string.Format("{0}='{1}'" + " and ", d.Key, d.Value));
            }
            string contion = str.Count() > 4? str.Remove(str.Count() - 4):"";

            return(ServerHelp.findDataByCondition <wrench>(contion, _webip));
        }
Exemplo n.º 29
0
        public List <borrow> SelectByCondition(Dictionary <string, string> condition)
        {
            string tablename = typeof(borrow).Name;
            string str       = "";

            foreach (var d in condition)
            {
                str += string.Format("{0}='{1}'" + " and ", d.Key, d.Value);
            }
            string scontion = str.Count() > 4 ? str.Remove(str.Count() - 4) : "";

            return(ServerHelp.findDataByCondition <borrow>(scontion, _webip));
        }
Exemplo n.º 30
0
        public List <torquechecktarget> SelectByContion(Dictionary <string, string> dict, int pagesize, int pageno)
        {
            string temp = "";

            foreach (var d in dict)
            {
                if (d.Key == "starttime")
                {
                    temp += string.Format("checkDate>='{0}' and ", d.Value);
                    continue;
                }
                if (d.Key == "endtime")
                {
                    temp += string.Format("checkDate<'{0}' and ", d.Value);
                    continue;
                }
                temp += string.Format("{0}='{1}' and ", d.Key, d.Value);
            }
            string contion = temp.Count() > 4 ? temp.Remove(temp.Count() - 4) : "";

            contion += string.Format("LIMIT {0},{1}", (pageno * pagesize), pagesize);
            return(ServerHelp.findDataByCondition <torquechecktarget>(contion, _webip));
        }