Ejemplo n.º 1
0
        public List <string> GetList()
        {
            List <string> listcount = new List <string>();
            wrench        w         = Wrench.selectByBarcode(_barcode);

            if (w == null || w.guid == null)
            {
                return(listcount);
            }
            for (int i = 1; i <= 12; i++)
            {
                string   s     = _datetime.Year.ToString() + "-" + string.Format("{0:00}", i);
                DateTime start = Convert.ToDateTime(s);
                DateTime lasts = start.AddMonths(1).AddMilliseconds(-1);
                List <torquechecktarget> tl = CheckTarget.SelectByDate(start, lasts, w.guid);
                if (tl != null)
                {
                    listcount.Add(tl.Count.ToString());
                }
                else
                {
                    listcount.Add("0");
                }
                datelist.Add(start.ToString("yyyy-MM"));
            }
            return(listcount);
        }
        bool IsRepeat(wrench w)
        {
            if (w == null)
            {
                return(false);
            }
            wrench tempw = Wrench.selectByBarcode(this.tb_wrenchbarcode.Text.Trim());

            if (tempw != null && w.guid != tempw.guid)
            {
                MessageBox.Show("工具条码号已经存在不能重复!");
                return(true);
            }
            List <wrench> wl = Wrench.selectBycode(w.wrenchCode);

            if (wl != null && wl.Count > 0)
            {
                foreach (wrench wc in wl)
                {
                    if (wc != null && wc.guid != w.guid)
                    {
                        MessageBox.Show("工具编号已经存在不能重复!");
                        return(true);
                    }
                }
            }

            return(false);
        }
Ejemplo n.º 3
0
        public List <string> GetList()
        {
            List <string> listcount = new List <string>();
            DateTime      first     = new DateTime();
            DateTime      last      = new DateTime();

            if (GetDaysOfWeeks(Convert.ToInt32(_datetime.Year), getweek(_datetime), out first, out last))
            {
                wrench w = Wrench.selectByBarcode(_barcode);
                if (w != null && w.guid != null)
                {
                    for (int i = 0; i < 7; i++)
                    {
                        DateTime dt = first.AddDays(i);

                        DateTime start = dt;
                        DateTime lasts = dt.AddDays(1).AddMilliseconds(-1);
                        List <torquechecktarget> tl = CheckTarget.SelectByDate(start, lasts, w.guid);
                        if (tl != null)
                        {
                            listcount.Add(tl.Count.ToString());
                        }
                        else
                        {
                            listcount.Add("0");
                        }
                        datelist.Add(dt.ToString("yyyy-MM-dd"));
                    }
                }
            }
            return(listcount);
        }
 wrench getwrench(wrench w)
 {
     try
     {
         w.wrenchCode    = this.tb_wrenchcode.Text.Trim();
         w.wrenchBarCode = this.tb_wrenchbarcode.Text.Trim();
         w.factory       = this.tb_factory.Text.Trim();
         w.rangeMax      = Convert.ToDecimal(this.tb_max.Text.Trim());
         w.rangeMin      = Convert.ToDecimal(this.tb_min.Text.Trim());
         w.comment       = this.tb_com.Text.Trim();
         w.offPset       = this.tb_Pset.Text.Trim();
         w.targetvalue   = Convert.ToDecimal(this.tb_targetvalue.Text.Trim());
         w.targetvalue1  = string.IsNullOrEmpty(this.tb_targetvalue1.Text.Trim()) ? 0 : Convert.ToDecimal(this.tb_targetvalue1.Text.Trim());
         w.targetvalue2  = string.IsNullOrEmpty(this.tb_targetvalue2.Text.Trim()) ? 0 : Convert.ToDecimal(this.tb_targetvalue2.Text.Trim());
         w.species       = (cb_species.SelectedItem as wrenchspecies).id.ToString();
         w.status        = (cb_status.SelectedItem as wrenchstatus).id.ToString();
         w.unit          = "N.m";
         w.createDate    = Convert.ToDateTime(Convert.ToDateTime(this.dp_time.Text.Trim()).ToString("s"));
         w.lastrepair    = Convert.ToDateTime(Convert.ToDateTime(this.dp_time_Copy.Text.Trim()).ToString("s"));
         return(w);
     }
     catch
     {
         MessageAlert.Alert("请输入正确的数字值!");
         return(null);
     }
 }
        private void cb_pages_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Dictionary <string, string> dict = new Dictionary <string, string>();

            if (!string.IsNullOrEmpty(this.tb_wrenchbarcode.Text.Trim()))
            {
                wrench wl = Wrench.selectByBarcode(this.tb_wrenchbarcode.Text.Trim());
                if (wl != null)
                {
                    dict.Add("WrenchID_id", wl.guid);
                }
            }
            if (this.dp_starttime.SelectedDate != null)
            {
                dict.Add("starttime", this.dp_starttime.SelectedDate.ToString());
            }
            if (this.dp_endtime.SelectedDate != null)
            {
                if (this.dp_endtime.SelectedDate.ToString() == this.dp_starttime.SelectedDate.ToString())
                {
                    dict.Add("endtime", this.dp_starttime.SelectedDate.Value.AddDays(1).AddSeconds(-1).ToString());
                }
                else
                {
                    dict.Add("endtime", this.dp_endtime.SelectedDate.ToString());
                }
            }
            CheckResultSetPage.PageSize   = Convert.ToInt32((this.cb_pages.SelectedItem as ComboBoxItem).Content.ToString());
            CheckResultSetPage.Dictionary = dict;
            CheckResultSetPage.getTotalPage();
            List <torquechecktarget> q = CheckResultSetPage.getTorquechecktarget(0);

            showdata(q);
        }
Ejemplo n.º 6
0
        ToolModel GetToolMode(wrench w)
        {
            ToolModel    tm = null;
            wrenchstatus ws = WrenchStatus.selectByguid(w.status);

            if (ws == null || ws.guid == null)
            {
                return(tm);
            }
            tm = new ToolModel()
            {
                wrenchBarCode = w.wrenchBarCode,
                wrenchCode    = w.wrenchCode,
                comment       = w.comment,
                createDate    = w.createDate,
                cycletime     = Convert.ToDecimal(w.cycletime.ToString("f0")),
                factory       = w.factory,
                guid          = w.guid,
                id            = w.id,
                IP            = w.IP,
                isallowcheck  = w.isallowcheck,
                lastrepair    = w.lastrepair,
                port          = w.port,
                rangeMax      = w.rangeMax,
                rangeMin      = w.rangeMin,
                species       = w.species,
                status        = w.status,
                statusName    = ws.statusName,
                targetvalue   = w.targetvalue,
                unit          = w.unit
            };
            return(tm);
        }
        void GetWrench(string wrenchbarcode)
        {
            if (borrowuser == null)
            {
                MessageAlert.Alert("没有借用人信息");
                return;
            }
            if (borrowwrenchlist.FindIndex(p => p.wrenchbarcode == wrenchbarcode) >= 0)
            {
                MessageAlert.Alert("不能重复添加!");
                return;
            }

            wrench w = Wrench.selectByBarcode(this.wrenchbarcode.Text.Trim());

            if (w != null)
            {
                borrowwrenchlist.Add(new BorrowWrench()
                {
                    wrenchbarcode = w.wrenchBarCode,
                    wrenchcode    = w.wrenchCode,
                    factory       = w.factory,
                    borrowdate    = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                    userguid      = borrowuser.user.guid,
                    username      = borrowuser.user.username,
                    operatorguid  = SystData.userInfo.user.guid,
                    options       = SystData.userInfo.user.username,
                    wrenchid      = w.id.ToString()
                });
            }
            ShowWrench(w);
            DgBind(borrowwrenchlist);
        }
Ejemplo n.º 8
0
 public bool Add(List <Model.torquechecktarget> listtorquechecktarget)
 {
     try
     {
         string sql = "";
         foreach (torquechecktarget torquechecktarget in listtorquechecktarget)
         {
             string  sqldep = string.Format("select * from wrench where id='{0}'", torquechecktarget.wrenchID);
             DataSet dps    = SqliteHelper.ExecuteDataSet(con, sqldep, CommandType.Text);
             if (dps != null && dps.Tables.Count > 0)
             {
                 wrench dep = DataTableToList.GetList <wrench>(dps.Tables[0]).FirstOrDefault();
                 if (dep != null)
                 {
                     torquechecktarget.wrenchID = dep.guid;
                 }
             }
             sql +=
                 string.Format
                 (
                     "INSERT INTO torquechecktarget(wrenchID_id,checkDate,qaID,operatorID,torqueTargetValue,errorRangeMax,errorRangeMin,count,arry,is_good,comment,guid) VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}') ;",
                     torquechecktarget.wrenchID, torquechecktarget.checkDate, torquechecktarget.qaID, torquechecktarget.operatorID, torquechecktarget.torqueTargetValue, torquechecktarget.errorRangeMax, torquechecktarget.errorRangeMin, torquechecktarget.count, torquechecktarget.arry, torquechecktarget.is_good == true?1:0, torquechecktarget.comment, torquechecktarget.guid
                 ) + "\r";
         }
         sql += " select last_insert_rowid()";
         var ds = SqliteHelper.ExecuteNonQuery(con, sql, CommandType.Text);
         if (Convert.ToInt32(ds) > 0)
         {
             return(true);
         }
         return(false);
     }
     catch { return(false); }
 }
Ejemplo n.º 9
0
 public string AddReturnGuid(Model.torquechecktarget torquechecktarget)
 {
     try
     {
         string  sqldep = string.Format("select * from wrench where id='{0}'", torquechecktarget.wrenchID);
         DataSet dps    = SqliteHelper.ExecuteDataSet(con, sqldep, CommandType.Text);
         if (dps != null && dps.Tables.Count > 0)
         {
             wrench dep = DataTableToList.GetList <wrench>(dps.Tables[0]).FirstOrDefault();
             if (dep != null)
             {
                 torquechecktarget.wrenchID = dep.guid;
             }
         }
         string sql =
             string.Format
             (
                 "INSERT INTO torquechecktarget(wrenchID_id,checkDate,qaID,operatorID,torqueTargetValue,errorRangeMax,errorRangeMin,count,arry,is_good,comment,guid) VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}') ;select last_insert_rowid()",
                 torquechecktarget.wrenchID, torquechecktarget.checkDate, torquechecktarget.qaID, torquechecktarget.operatorID, torquechecktarget.torqueTargetValue, torquechecktarget.errorRangeMax, torquechecktarget.errorRangeMin, torquechecktarget.count, torquechecktarget.arry, torquechecktarget.is_good == true?1:0, torquechecktarget.comment, torquechecktarget.guid
             );
         var ds = SqliteHelper.ExecuteScalar(con, sql, CommandType.Text);
         return(ds.ToString());
     }
     catch
     {
         return("-1");
     }
 }
Ejemplo n.º 10
0
        List <ReturnWrench> GetBorrowInfo(string userguid)
        {
            try
            {
                List <ReturnWrench> rwl = new List <ReturnWrench>();
                List <borrow>       bl  = Borrow.SelectByUser(userguid, false);
                if (bl == null || bl.Count <= 0)
                {
                    return(null);
                }

                foreach (borrow b in bl)
                {
                    wrench w        = Wrench.selectByguid(b.WrenchID);
                    users  u        = User.SelectByguid(b.borrowUser);
                    users  operatos = User.SelectByguid(b.borrowOperator);
                    rwl.Add(new ReturnWrench()
                    {
                        wrenchbarcode = w.wrenchBarCode,
                        wrenchcode    = w.wrenchCode,
                        wrenchguid    = w.guid,
                        cardid        = u.cardID,
                        username      = u.username,
                        factory       = w.factory,
                        rang          = w.rangeMin.ToString("f2") + "~" + w.rangeMin.ToString("f2"),
                        borrowdate    = b.borrowDate.Replace('T', ' '),
                        operater      = operatos.username,
                        wrenchcommit  = w.comment
                    });
                }
                return(rwl);
            }
            catch { return(null); }
        }
Ejemplo n.º 11
0
        ReturnWrench GetReturnWrench(BorrowWrench br)
        {
            ReturnWrench  rw = new ReturnWrench();
            List <borrow> bl = Borrow.SelectByWrench(br.wrenchguid, br.userguid, false);

            if (bl != null && bl.Count > 0)
            {
                borrow b        = bl.FirstOrDefault();
                wrench w        = Wrench.selectByguid(b.WrenchID);
                users  u        = User.SelectByguid(b.borrowUser);
                users  operatos = User.SelectByguid(b.borrowOperator);
                _returnwrench.Add(new ReturnWrench()
                {
                    wrenchbarcode = w.wrenchBarCode,
                    wrenchcode    = w.wrenchCode,
                    wrenchguid    = w.guid,
                    cardid        = u.cardID,
                    username      = u.username,
                    factory       = w.factory,
                    rang          = w.rangeMin.ToString("f2") + "~" + w.rangeMin.ToString("f2"),
                    borrowdate    = b.borrowDate.Replace('T', ' '),
                    operater      = operatos.username,
                    wrenchcommit  = w.comment
                });

                return(rw);
            }
            return(null);
        }
Ejemplo n.º 12
0
 public static PrintSingleCheckdata GetPrintSingleCheckdata(wrench wrenchmodel, List <ShowCheckresult> checkrecodelist, int configcount, decimal setvalue, userinfo juser, userinfo zuser, DateTime dt, bool wrenchgood)
 {
     if (printsinglecheckdata == null || !printsinglecheckdata.IsLoaded)
     {
         printsinglecheckdata = new PrintSingleCheckdata(wrenchmodel, checkrecodelist, configcount, setvalue, juser, zuser, dt, wrenchgood);
     }
     return(printsinglecheckdata);
 }
Ejemplo n.º 13
0
 bool add(wrench w)
 {
     w.createDate   = Convert.ToDateTime(this.dp_time.Text.Trim());
     w.lastrepair   = Convert.ToDateTime(this.dp_time_Copy.Text.Trim());
     w.guid         = Guid.NewGuid().ToString();
     w.isallowcheck = true;
     w.cycletime    = 0;
     return(Wrench.add(w));
 }
Ejemplo n.º 14
0
        private void Button_Click_18(object sender, RoutedEventArgs e)
        {
            wrench w = Wrench.selectByBarcode("222");

            w.rangeMax = 200;
            w.species  = "e8ad22ee-1f00-4b2a-94ee-a84d3b692f7d";
            w.status   = "123";
            Wrench.updata(w);
        }
Ejemplo n.º 15
0
        private void Button_Click_14(object sender, RoutedEventArgs e)
        {
            wrench w = new wrench()
            {
                createDate = DateTime.Now, factory = "nuba", rangeMax = Convert.ToDecimal(32.9), rangeMin = Convert.ToDecimal(0.5), species = "1", status = "2", wrenchBarCode = "1234", wrenchCode = "2345"
            };

            MessageBox.Show(Wrench.add(w).ToString());
        }
Ejemplo n.º 16
0
 void ShowWrench(wrench e)
 {
     if (e == null)
     {
         return;
     }
     this.wrenchcode.Text     = e.wrenchCode;
     this.cb_wrench.IsEnabled = true;
 }
Ejemplo n.º 17
0
        private void editButtonClick(object sender, RoutedEventArgs e)
        {
            int i_index = dataGrid1.SelectedIndex;

            if (i_index >= 0)
            {
                _wrench = dataGrid1.SelectedItem as wrench;
                showwrench(_wrench);
                isadd = false;
            }
        }
Ejemplo n.º 18
0
 public HandleData(users juser, userinfo zuser, wrench wrenchmodel, bool wrenchisgood, decimal setvalue = 0, decimal errorrangmin = 0, decimal errorrangmax = 0)
 {
     _wrench = wrenchmodel;
     //_checkdatashow = checkdatashow;
     _setvalue     = setvalue;
     _errorrangmin = errorrangmin;
     _errorrangmax = errorrangmax;
     _systemset    = GetSystem();
     _juser        = juser;
     _zuser        = zuser;
     _wrenchisgood = wrenchisgood;
 }
Ejemplo n.º 19
0
 void clear()
 {
     this.tb_factory.Clear();
     this.tb_max.Clear();
     this.tb_min.Clear();
     this.tb_targetvalue.Clear();
     this.tb_wrenchbarcode.Clear();
     this.tb_wrenchcode.Clear();
     isadd             = true;
     _wrench           = null;
     this.dp_time.Text = DateTime.Now.ToShortDateString();
     getstatus();
 }
Ejemplo n.º 20
0
 PrintSingleCheckdata(wrench wrenchmodel, List <ShowCheckresult> checkrecodelist, int confgcount, decimal setvalue, userinfo juser, userinfo zuser, DateTime dt, bool wrenchgood)
 {
     InitializeComponent();
     _wrench       = wrenchmodel;
     _checkhistory = checkrecodelist;
     _zuser        = zuser;
     _juser        = juser;
     _dt           = dt;
     confint       = confgcount;
     _setvalue     = setvalue;
     _iswrenchgood = wrenchgood;
     showdata();
 }
        private void bt_search_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(this.tb_wrenchbarcode.Text.Trim()))
            {
                MessageAlert.Alert("请填写工具条码!");
                return;
            }
            if (this.dp_date.SelectedDate.ToString() == "")
            {
                MessageAlert.Alert("请选择时间!");
                return;
            }

            List <string> strListy = new List <string>();
            List <string> strListx = new List <string>();
            DateTime      time     = Convert.ToDateTime(this.dp_date.SelectedDate.ToString());
            wrench        w        = Wrench.selectByBarcode(this.tb_wrenchbarcode.Text.Trim());

            if (rb_week.IsChecked != null && rb_week.IsChecked == true)
            {
                WeekCheckData weekcheckdata = new WeekCheckData(time, this.tb_wrenchbarcode.Text.Trim());
                strListy = weekcheckdata.GetList();
                strListx = weekcheckdata.datelist;
            }



            if (rb_year.IsChecked != null && rb_year.IsChecked == true)
            {
                YearCheckData weekcheckdata = new YearCheckData(time, this.tb_wrenchbarcode.Text.Trim());
                strListy = weekcheckdata.GetList();
                strListx = weekcheckdata.datelist;
            }

            int count = 0;

            foreach (string s in strListy)
            {
                count += Convert.ToInt32(s);
            }
            this.lb_count.Content = "校验总次数:" + count.ToString();
            this.lb_bar.Content   = "工具编码:" + (w != null ? w.wrenchCode : "");
            ColumnSeries cs = new ColumnSeries(strListx, strListy);

            if (cs.CreateChar() != null)
            {
                this.chart.Children.Add(cs.CreateChar());
            }
        }
Ejemplo n.º 22
0
        ToolModel GetToolModel(wrench w)
        {
            wrenchspecies ws = WrenchSpecies.selectByGuid(w.species);

            return(new ToolModel()
            {
                wrenchBarCode = w.wrenchBarCode,
                wrenchCode = w.wrenchCode,
                speciesName = ws.speciesName,
                lastrepair = w.lastrepair,
                cycletime = Convert.ToDecimal(w.cycletime.ToString("f0")),
                isallowcheck = w.isallowcheck,
                guid = w.guid
            });
        }
        List <WrenchCheckOut> getshowdata(List <torquechecktarget> torquetargetlist)
        {
            GetUser gu = new GetUser();
            List <WrenchCheckOut> tempwcolist = new List <WrenchCheckOut>();

            if (torquetargetlist == null)
            {
                return(tempwcolist);
            }
            foreach (torquechecktarget t in torquetargetlist)
            {
                userinfo juser = new userinfo();
                userinfo zuser = new userinfo();
                juser = gu.getuserinfo(gu.getusers(t.operatorID));
                if (juser == null || juser.user == null)
                {
                    users jusers = new users();
                    jusers.username = t.operatorID;
                    juser.user      = jusers;
                    department d = new department();
                    d.departmentName = t.operatorID;
                    juser.department = d;
                }
                if (!string.IsNullOrEmpty(t.qaID))
                {
                    zuser = gu.getuserinfo(gu.getusers(t.qaID));
                }
                wrench tempw = Wrench.selectByguid(t.wrenchID);

                tempwcolist.Add(new WrenchCheckOut()
                {
                    wrenchcode        = tempw.wrenchCode,
                    wrenchbarcode     = tempw.wrenchBarCode,
                    jusername         = (juser == null || juser.user == null)?"":juser.user.username,
                    zusername         = (zuser == null || zuser.user == null)?"":zuser.user.username,
                    juserinfo         = juser,
                    zuserinfo         = zuser,
                    torquetargetvalue = t.torqueTargetValue.ToString(),
                    errorrange        = (t.torqueTargetValue * (1 + Convert.ToDecimal(t.errorRangeMin))).ToString("f2") + "~" + (t.torqueTargetValue * (1 + Convert.ToDecimal(t.errorRangeMax))).ToString("f2"),
                    errormax          = Convert.ToDecimal(t.errorRangeMax).ToString("f4"),
                    errormin          = Convert.ToDecimal(t.errorRangeMin).ToString("f4"),
                    is_good           = t.is_good,
                    checkdate         = t.checkDate.ToString().Replace('T', ' '),
                    guid = t.guid
                });
            }
            return(tempwcolist);
        }
Ejemplo n.º 24
0
        void ShowWrench(wrench e)
        {
            if (e == null)
            {
                return;
            }
            IWrenchStatus WrenchStatus = DataAccess.CreateWrenchStatus();
            wrenchstatus  w            = WrenchStatus.selectByguid(e.status);

            if (w != null)
            {
                this.wrenchstatus.Text = w.statusName;
            }
            this.wrenchcode.Text     = e.wrenchCode;
            this.cb_wrench.IsEnabled = true;
        }
Ejemplo n.º 25
0
 bool isexit(wrench w)
 {
     if (w == null)
     {
         return(true);
     }
     if (Wrench.selectByBarcode(w.wrenchBarCode) != null)
     {
         MessageBox.Show("工具条码号已经存在不能重复!"); return(true);
     }
     if (Wrench.selectBycode(w.wrenchCode) != null && Wrench.selectBycode(w.wrenchCode).Count > 0)
     {
         MessageBox.Show("工具编号已经存在不能重复!"); return(true);
     }
     return(false);
 }
Ejemplo n.º 26
0
 bool update(wrench w)
 {
     //if (w.cycletime == null||w.cycletime<=0)
     //    w.cycletime = 0;
     try
     {
         w.cycletime = Convert.ToDecimal(w.cycletime);
     }
     catch
     {
         w.cycletime = 0;
     }
     w.species = (cb_species.SelectedItem as wrenchspecies).guid.ToString();
     w.status  = (cb_status.SelectedItem as wrenchstatus).guid.ToString();
     return(Wrench.updata(w));
 }
Ejemplo n.º 27
0
        void BindGrid(List <ToolModel> tl)
        {
            List <ToolModel> tempt = new List <ToolModel>();

            foreach (ToolModel tm in tl)
            {
                wrench    w = Wrench.selectByBarcode(tm.wrenchBarCode);
                ToolModel t = GetToolMode(w);
                if (t != null)
                {
                    tempt.Add(t);
                }
            }
            this.dt_showdata.ItemsSource = null;
            this.dt_showdata.ItemsSource = tempt;
            tl.Clear();
        }
Ejemplo n.º 28
0
        public wrenchinfo GetWrenchinfo(string barcode)
        {
            wrench w = Wrench.selectByBarcode(barcode);

            if (w == null)
            {
                return(null);
            }
            wrenchspecies ws  = WrenchSpecies.selectByGuid(w.species);
            wrenchstatus  wss = WrenchStatus.selectByguid(w.status);
            wrenchinfo    wi  = new wrenchinfo();

            wi.wrench  = w;
            wi.species = ws;
            wi.status  = wss;
            return(wi);
        }
Ejemplo n.º 29
0
        bool updata(string type)
        {
            try
            {
                for (int i = 0; i < dt_showdata.Items.Count; i++)
                {
                    var         cntr   = dt_showdata.ItemContainerGenerator.ContainerFromIndex(i);
                    DataGridRow ObjROw = (DataGridRow)cntr;
                    if (ObjROw != null)
                    {
                        FrameworkElement objElement = dt_showdata.Columns[0].GetCellContent(ObjROw);
                        if (objElement != null)
                        {
                            System.Windows.Controls.CheckBox objChk = (System.Windows.Controls.CheckBox)objElement;
                            if (objChk.IsChecked == true)
                            {
                                ToolModel tm = ObjROw.Item as ToolModel;
                                if (tm == null || tm.guid == null)
                                {
                                    continue;
                                }
                                wrench s = new wrench();
                                if (type == "001")
                                {
                                    s = Wrench.selectByguid(tm.guid);
                                    wrenchstatus ws = WrenchStatus.selectByStatusDM(type);
                                    s.status     = ws.guid;
                                    s.lastrepair = DateTime.Now;
                                }
                                if (type == "002")
                                {
                                    s = Wrench.selectByguid(tm.guid);
                                    wrenchstatus ws = WrenchStatus.selectByStatusDM(type);
                                    s.status = ws.guid;
                                }

                                Wrench.updata(s);
                            }
                        }
                    }
                }
                return(true);
            }
            catch { return(false); }
        }
Ejemplo n.º 30
0
        private void delButtonClick(object sender, RoutedEventArgs e)
        {
            int i_index = dataGrid1.SelectedIndex;

            if (i_index >= 0)
            {
                _wrench = dataGrid1.SelectedItem as wrench;
                if (MessageAlert.Alter("是否删除该条记录"))
                {
                    if (SqlietDelWrench(_wrench))
                    {
                        getwrenchlist(Gettoolmodel(Wrench.selectPage(pagesize, pageno)));
                        getstatus();
                        clear();
                    }
                }
            }
        }