Beispiel #1
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int Delete(BaseEntity p_Entity)
        {
            try
            {
                CheckForm MasterEntity = (CheckForm)p_Entity;
                if (MasterEntity.ID == 0)
                {
                    return(0);
                }

                //删除主表数据
                string Sql = "";
                Sql = "DELETE FROM ADH_CheckForm WHERE " + "ID=" + SysString.ToDBString(MasterEntity.ID);
                //执行
                int AffectedRows = 0;
                if (!this.sqlTransFlag)
                {
                    AffectedRows = this.ExecuteNonQuery(Sql);
                }
                else
                {
                    AffectedRows = sqlTrans.ExecuteNonQuery(Sql);
                }

                return(AffectedRows);
            }
            catch (BaseException E)
            {
                throw new BaseException(E.Message, E);
            }
            catch (Exception E)
            {
                throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBDelete), E);
            }
        }
Beispiel #2
0
        private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
        {
            if ((PbPassword1.Password != PbPassword2.Password) || PbPassword1.Password.Equals(String.Empty) || (TbMail.Text.Equals(String.Empty) && TbPhoneNumber.Text.Equals(String.Empty)))
            {
                args.Cancel = true;
                return;
            }

            if (!TbMail.Text.Equals(String.Empty))
            {
                if (!CheckForm.IsMail(TbMail.Text))
                {
                    args.Cancel = true;
                    return;
                }
            }

            if (!CheckForm.IsPasspordId(TbPassportID.Text))
            {
                args.Cancel = true;
                return;
            }

            Client = new Client()
            {
                FirstName   = TbFirstName.Text,
                LastName    = TbLastName.Text,
                Patronymic  = TbPatronymic.Text,
                PassportID  = TbPassportID.Text,
                Mail        = TbMail.Text == String.Empty ? null : TbMail.Text,
                PhoneNumber = TbPhoneNumber.Text == String.Empty ? null : TbPhoneNumber.Text,
                Password    = PbPassword1.Password
            };
        }
        private void button1_Click(object sender, EventArgs e)  //执行双击的事件
        {
            IEnumFeature pEnumFeature = axMapControl1.Map.FeatureSelection as IEnumFeature;

            pFeature = pEnumFeature.Next();
            if (pFeature == null)
            {
                return;
            }
            pGeometry = new PolygonClass();
            pGeometry = pFeature.Shape;

            //加载检测文本框
            CheckForm checkForm = new CheckForm();

            checkForm.treeView1.Nodes[0].Text          = axMapControl1.Map.get_Layer(0).Name;                            //加载图层名称
            checkForm.treeView1.Nodes[0].Nodes[0].Text = pFeature.get_Value(pFeature.Fields.FindField("Id")).ToString(); //加载Id值
            checkForm.textBox1.Text  = pFeature.get_Value(pFeature.Fields.FindField("FID")).ToString();                  //加载FID的值
            checkForm.textBox2.Text  = pFeature.get_Value(pFeature.Fields.FindField("Id")).ToString();                   //加载Id的值
            checkForm.comboBox1.Text = pFeature.get_Value(pFeature.Fields.FindField("Type")).ToString();                 //加载Type的值
            checkForm.button2.Click += new System.EventHandler(CheckButton2);                                            //添加检测事件
            checkForm.button3.Click += new System.EventHandler(CheckButton3);
            checkForm.Load          += new System.EventHandler(CheckLoad);
            checkForm.FormClosing   += new System.Windows.Forms.FormClosingEventHandler(CheckClosing);
            checkForm.ShowDialog();
        }
Beispiel #4
0
        private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
        {
            if (
                TbFirstName.Text.Equals(String.Empty) ||
                TbLastName.Text.Equals(String.Empty) ||
                TbPassportID.Text.Equals(String.Empty) ||
                TbUsername.Text.Equals(String.Empty) ||
                CbPostion.SelectedItem == null ||
                PbPassword.Password.Equals(String.Empty)
                )
            {
                args.Cancel = true;
                return;
            }

            if (!CheckForm.IsPasspordId(TbPassportID.Text))
            {
                args.Cancel = true;
                return;
            }

            if (Employee == null)
            {
                Employee = new Employee();
            }
            Employee.FirstName  = TbFirstName.Text;
            Employee.LastName   = TbLastName.Text;
            Employee.Patronymic = TbPatronymic.Text;
            Employee.PassportID = TbPassportID.Text;
            Employee.Username   = TbUsername.Text;
            Employee.PositionId = ((Position)CbPostion.SelectedItem).Id;
            Employee.Position   = null;
            Employee.Password   = PbPassword.Password;
        }
Beispiel #5
0
        /// <summary>
        /// 新增(传入事务处理)
        /// </summary>
        /// <param name="p_BE">要新增的实体</param>
        /// <param name="sqlTrans">事务类</param>
        public void RAdd(BaseEntity p_BE, IDBTransAccess sqlTrans)
        {
            try
            {
                this.CheckCorrect(p_BE);
                CheckForm    entity  = (CheckForm)p_BE;
                CheckFormCtl control = new CheckFormCtl(sqlTrans);
                entity.ID = (int)EntityIDTable.GetID((long)SysEntity.ADH_CheckForm, sqlTrans);

                string    sql = "SELECT FormCode FROM ADH_CheckForm WHERE FormCode=" + SysString.ToDBString(entity.FormCode);
                DataTable dt  = sqlTrans.Fill(sql);
                if (dt.Rows.Count > 0)
                {
                    throw new BaseException("单号已存在,请重新生成");
                }


                control.AddNew(entity);

                FormNoControlRule prule = new FormNoControlRule();

                prule.RAddSort((int)FormNoControlEnum.样品报价单号, sqlTrans);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Beispiel #6
0
        /// <summary>
        /// 获得实体
        /// </summary>
        /// <returns></returns>
        private CheckForm EntityGet()
        {
            CheckForm entity = new CheckForm();

            entity.ID = HTDataID;
            return(entity);
        }
        private void ButtonCheckGenerator_Click(object sender, EventArgs e)
        {
            if (ComboBoxSelectViewType.EditValue == null)
            {
                MessageBox.Show("Необходимо указать тип представления");
                return;
            }

            var form = new CheckedBody();

            string jsonParams = string.Empty;

            if (form.ShowDialog() == DialogResult.OK)
            {
                jsonParams = form.JsonBody;
            }

            dynamic item      = MetadataGeneratorSelect.EditValue;
            var     result    = ViewModelExtension.CheckGetView(Version(), ConfigId(), item.DocumentId, NameEditor.Text, ComboBoxSelectViewType.EditValue.ToString(), jsonParams);
            var     checkForm = new CheckForm();

            checkForm.MemoText = result;
            checkForm.BodyText = "";
            checkForm.UrlText  = "";
            checkForm.ShowDialog();
        }
Beispiel #8
0
        public JsonResult Form(CheckForm form)
        {
            form.ByUserID = UserSession.UserID;
            var id = Facade <ConnectorFacade>().SaveCheck(form);

            return(Json(id, JsonRequestBehavior.AllowGet));
        }
Beispiel #9
0
        /// <summary>
        /// 删除
        /// </summary>
        public override void EntityDelete()
        {
            CheckFormRule rule   = new CheckFormRule();
            CheckForm     entity = EntityGet();

            rule.RDelete(entity);
        }
Beispiel #10
0
        public void Test_4_1()
        {
            var howHelp  = new HowHelp();
            var homePage = new HomePage();

            PageFactory.InitElements(driver, homePage);
            PageFactory.InitElements(driver, howHelp);
            var action = new OpenQA.Selenium.Interactions.Actions(driver);

            //Clicking on the tabs
            action.MoveToElement(homePage.weAreWabash).Perform();
            System.Threading.Thread.Sleep(500);
            homePage.ourCulture.Click();

            System.Threading.Thread.Sleep(2000);

            //Scroll page down
            ((IJavaScriptExecutor)driver).ExecuteScript("window.scrollTo(0, document.body.scrollHeight - 150)");

            //Choose Choice
            howHelp.choice.Click();
            System.Threading.Thread.Sleep(500);
            howHelp.secondChoice.Click();

            //Choose Country
            howHelp.country.Click();
            System.Threading.Thread.Sleep(500);
            howHelp.canada.Click();

            //Type Name
            howHelp.name.SendKeys("T-800");

            //Type Company
            howHelp.company.SendKeys("SkyNet");

            //Type E-Mail
            howHelp.email.SendKeys("*****@*****.**");

            //Type Phone number
            howHelp.phone.SendKeys("123-456-789");

            //Type Comments
            howHelp.comments.SendKeys("Can you give me your dress and motorbike?");
            System.Threading.Thread.Sleep(2000);
            howHelp.submit.Click();
            System.Threading.Thread.Sleep(2000);

            //Scroll page down
            ((IJavaScriptExecutor)driver).ExecuteScript("window.scrollTo(0, document.body.scrollHeight - 150)");
            System.Threading.Thread.Sleep(3000);

            IWebElement element = driver.FindElement(By.ClassName("sfSuccess"));

            bool res = CheckForm.result(element);

            System.Threading.Thread.Sleep(2000);

            Assert.IsTrue(res, "The form was not submited");
        }
Beispiel #11
0
        /// <summary>
        /// 修改
        /// </summary>
        public override void EntityUpdate()
        {
            CheckFormRule rule   = new CheckFormRule();
            CheckForm     entity = EntityGet();

            CheckFormDts[] entitydts = EntityDtsGet();
            rule.RUpdate(entity, entitydts);
        }
Beispiel #12
0
        private void btn_checkout_Click(object sender, EventArgs e)
        {
            CheckForm checkForm = new CheckForm();

            checkForm.Show();//非模态单独窗口,需要和其他窗口交互
            //checkForm.ShowInTaskbar = false;
            //checkForm.ShowDialog();
        }
Beispiel #13
0
 private void btn审核_Click(object sender, EventArgs e)
 {
     if (!check出库数量())
     {
         return;
     }
     ckform = new mySystem.CheckForm(this);
     ckform.Show();
 }
Beispiel #14
0
        /// <summary>
        /// 新增
        /// </summary>
        public override int EntityAdd()
        {
            CheckFormRule rule   = new CheckFormRule();
            CheckForm     entity = EntityGet();

            CheckFormDts[] entitydts = EntityDtsGet();
            rule.RAdd(entity, entitydts);
            return(entity.ID);
        }
Beispiel #15
0
 public int SaveCheck(CheckForm form)
 {
     using (var uow = UnitOfWorkFactory.Create <NovelContext>())
     {
         var service = new CheckService(uow);
         var id      = service.SaveChanges(form);
         return(id);
     }
 }
Beispiel #16
0
        /// <summary>
        /// 扫描数据(传入事务处理)
        /// </summary>
        /// <param name="p_BE">要新增的实体</param>
        /// <param name="sqlTrans">事务类</param>
        public int RScan(int p_ID, string p_ISN, int p_YPQty, string p_Vendorid, int p_ZHID, DateTime p_Time, IDBTransAccess sqlTrans)
        {
            int outi = 0;

            try
            {
                CheckForm entity = new CheckForm(sqlTrans);
                if (p_ID == 0)
                {
                    FormNoControlRule prule = new FormNoControlRule();

                    //entity.FormCode = prule.RGetFormNo("ADH_CheckForm", "FormCode", sqlTrans);

                    entity.FormCode = prule.RGetFormNo((int)FormNoControlEnum.样品报价单号);

                    entity.DVendorID = p_Vendorid;
                    entity.FormDate  = DateTime.Now;
                    entity.DataDHID  = p_ZHID;
                    entity.BJHL      = 1;
                    this.RAdd(entity, sqlTrans);
                    outi = entity.ID;
                    CheckFormDtsRule dtsrule = new CheckFormDtsRule();
                    dtsrule.RScan(entity.ID, p_ISN, p_YPQty, p_Time, sqlTrans);
                }
                else
                {
                    outi      = p_ID;
                    entity.ID = p_ID;
                    if (entity.SelectByID())//找到订货单
                    {
                        if (entity.SubmitFlag == (int)YesOrNo.Yes)
                        {
                            throw new Exception("单据已完成,不能操作");
                        }

                        CheckFormDtsRule dtsrule = new CheckFormDtsRule();
                        dtsrule.RScan(entity.ID, p_ISN, p_YPQty, p_Time, sqlTrans);
                    }
                }


                //记录扫描历史
                string sql = string.Empty;
                sql = "INSERT INTO ADH_ScanHis(ISN,DataDHID,DVendorID) VALUES(" + SysString.ToDBString(p_ISN) + "," + SysString.ToDBString(p_ZHID) + "," + SysString.ToDBString(p_Vendorid) + ")";
                sqlTrans.ExecuteNonQuery(sql);
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
            return(outi);
        }
 //审核功能
 private void btn审核_Click(object sender, EventArgs e)
 {
     if (mySystem.Parameter.userName == dt记录详情.Rows[0]["操作员"].ToString())
     {
         MessageBox.Show("当前登录的审核员与操作员为同一人,不可进行审核!");
         return;
     }
     checkform = new CheckForm(this);
     checkform.Show();
 }
Beispiel #18
0
 private void btn审核_Click(object sender, EventArgs e)
 {
     if (mySystem.Parameter.userName == dtOuter.Rows[0]["申请人"].ToString())
     {
         MessageBox.Show("申请人和审核员不能是同一个人");
         return;
     }
     ckform = new mySystem.CheckForm(this);
     ckform.Show();
 }
Beispiel #19
0
 private void btn审核_Click(object sender, EventArgs e)
 {
     if (dtOuter.Rows[0]["操作员"].ToString() == mySystem.Parameter.userName)
     {
         MessageBox.Show("操作员和审核员不能是同一个人!");
         return;
     }
     ckform = new CheckForm(this);
     ckform.Show();
 }
Beispiel #20
0
 private void btn审核_Click(object sender, EventArgs e)
 {
     // TODO 弹出赵梦的窗口
     if (mySystem.Parameter.userName == tb操作员.Text)
     {
         MessageBox.Show("审核员不能和操作员为同一个人");
         return;
     }
     checkform = new CheckForm(this);
     checkform.Show();
 }
Beispiel #21
0
        /// <summary>
        /// 设置
        /// </summary>
        public override void EntitySet()
        {
            Common.BindVendor(drpVendorID, new int[] { (int)EnumVendorType.客户 }, true);

            CheckForm entity = new CheckForm();

            entity.ID = HTDataID;
            bool findFlag = entity.SelectByID();

            txtFormCode.Text      = entity.FormCode.ToString();
            txtFormDate.DateTime  = entity.FormDate;
            drpDataDHID.EditValue = entity.DataDHID;
            if (entity.DVendorName == "")
            {
                txtVendorName.Text = Common.GetVendorNameByVendorID(entity.DVendorID);
            }
            else
            {
                txtVendorName.Text = entity.DVendorName.ToString();
            }
            txtVendorID.Text      = entity.DVendorID.ToString();
            txtRemark.Text        = entity.DRemark.ToString();
            drpBJHB.EditValue     = entity.BJHB;
            txtBJHL.Text          = entity.BJHL.ToString();
            txtAddress.Text       = entity.Address.ToString();
            txtTel.Text           = entity.Tel.ToString();
            txtConOPName.Text     = entity.ConOPName.ToString();
            drpSaleOPID.EditValue = entity.SaleOPID.ToString();
            drpLevel.EditValue    = entity.LevelID;
            if (txtBJHL.Text == "0")
            {
                txtBJHL.Text = "1";
            }
            if (entity.DYFlag == 1)
            {
                chkDYFlag.Checked = true;
            }
            else
            {
                chkDYFlag.Checked = false;
            }

            //if (entity.SubmitFlag == 0)
            //{
            //    label8.Text = "进行中";
            //}
            //else
            //{
            //    label8.Text = "已完成";
            //}
            HTDataSubmitFlag = entity.SubmitFlag;
            BindGridDts();
            lblTime.Text = "扫描时间:" + SysConvert.ToString(gridView1.GetRowCellValue(gridView1.RowCount - 1, "AddTime"));
        }
Beispiel #22
0
 private void btn审核_Click(object sender, EventArgs e)
 {
     foreach (DataRow dr in dtInner.Rows)
     {
         if (dr["审核员"] == DBNull.Value || dr["审核员"].ToString() == "" || dr["审核员"].ToString().Trim() == "__待审核")
         {
             MessageBox.Show("请先完成数据审核");
             return;
         }
     }
     check = new CheckForm(this);
     check.ShowDialog();
 }
Beispiel #23
0
        public int SaveChanges(CheckForm form)
        {
            var tCheck = Table <Check>();

            var check = tCheck.GetOrAdd(w => w.ID == form.ID ||
                                        (form.ID == 0 && w.Type == form.Type && w.SourceID == form.SourceID && w.SourceTable == form.SourceTable));

            MapProperty(form, check, form.InlineEditProperty);
            UpdateAuditFields(check, form.ByUserID);
            // save
            SaveChanges();

            return(check.ID);
        }
Beispiel #24
0
 private void btn审核_Click(object sender, EventArgs e)
 {
     // 如果有不是yes的,就不准审核
     foreach (DataGridViewRow gdvr in dataGridView1.Rows)
     {
         if (gdvr.DefaultCellStyle.BackColor == Color.Red)
         {
             MessageBox.Show("有条目待确认");
             return;
         }
     }
     check = new CheckForm(this);
     check.Show();
 }
 //审核功能
 private void btn审核_Click(object sender, EventArgs e)
 {
     if (check当前登录的审核员与操作员())
     {
         MessageBox.Show("当前登录的审核员与操作员为同一人,不可进行审核!");
         return;
     }
     else if (need数据审核())
     {
         MessageBox.Show("需要数据审核");
         return;
     }
     checkform = new CheckForm(this);
     checkform.Show();
 }
Beispiel #26
0
 /// <summary>
 /// 扫描数据(传入事务处理)
 /// </summary>
 /// <param name="p_BE">要新增的实体</param>
 /// <param name="sqlTrans">事务类</param>
 public void RScanCancel(int p_ID, string p_ISN, IDBTransAccess sqlTrans)
 {
     try
     {
         CheckForm entity = new CheckForm(sqlTrans);
         if (p_ID == 0)
         {
             throw new Exception("未找到单据");
         }
         else
         {
             entity.ID = p_ID;
             entity.SelectByID();
             if (entity.SubmitFlag == (int)YesOrNo.Yes)
             {
                 throw new Exception("单据已完成,不能操作");
             }
             string sql = string.Empty;
             if (p_ISN == string.Empty)
             {
                 sql = "DELETE FROM ADH_CheckFormDts WHERE MainID=" + SysString.ToDBString(p_ID);
                 sqlTrans.ExecuteNonQuery(sql);
             }
             else
             {
                 if (sqlTrans.Fill("SELECT MainID FROM ADH_CheckFormDts WHERE MainID=" + SysString.ToDBString(p_ID) + " AND ISN=" + SysString.ToDBString(p_ISN)).Rows.Count != 0)
                 {
                     sql = "DELETE FROM ADH_CheckFormDts WHERE MainID=" + SysString.ToDBString(p_ID) + " AND ISN=" + SysString.ToDBString(p_ISN);
                     sqlTrans.ExecuteNonQuery(sql);
                 }
                 else
                 {
                     throw new Exception("单据内未找到此条码");
                 }
             }
         }
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
Beispiel #27
0
 //审核按钮
 private void btn审核_Click(object sender, EventArgs e)
 {
     foreach (DataGridViewRow gdvr in dataGridView1.Rows)
     {
         if (gdvr.DefaultCellStyle.BackColor == Color.Red)
         {
             MessageBox.Show("有条目待确认");
             return;
         }
     }
     if (mySystem.Parameter.userName == dt记录.Rows[0]["操作员"].ToString())
     {
         MessageBox.Show("当前登录的审核员与操作员为同一人,不可进行审核!");
         return;
     }
     checkform = new CheckForm(this);
     checkform.ShowDialog();
 }
Beispiel #28
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="p_BE">要修改的实体</param>
 /// <param name="sqlTrans">事务类</param>
 public void RUpdate(BaseEntity p_BE, IDBTransAccess sqlTrans)
 {
     try
     {
         this.CheckCorrect(p_BE);
         CheckForm    entity  = (CheckForm)p_BE;
         CheckFormCtl control = new CheckFormCtl(sqlTrans);
         control.Update(entity);
     }
     catch (BaseException)
     {
         throw;
     }
     catch (Exception E)
     {
         throw new BaseException(E.Message);
     }
 }
Beispiel #29
0
 //审核功能
 private void btn审核_Click(object sender, EventArgs e)
 {
     foreach (DataRow dr in dt记录详情.Rows)
     {
         if (dr["审核员"] == DBNull.Value || dr["审核员"].ToString() == "" || dr["审核员"].ToString().Trim() == "__待审核")
         {
             MessageBox.Show("请先完成数据审核");
             return;
         }
     }
     if (mySystem.Parameter.userName == dt记录详情.Rows[0]["操作员"].ToString())
     {
         MessageBox.Show("当前登录的审核员与操作员为同一人,不可进行审核!");
         return;
     }
     checkform = new CheckForm(this);
     checkform.Show();
 }
Beispiel #30
0
 //审核功能
 private void btn审核_Click(object sender, EventArgs e)
 {
     if (mySystem.Parameter.userName == dt记录详情.Rows[0]["操作员"].ToString())
     {
         MessageBox.Show("当前登录的审核员与操作员为同一人,不可进行审核!");
         return;
     }
     //先进行内表审核,再进行外表审核
     for (int i = 0; i < dataGridView1.Rows.Count; i++)
     {
         if (dataGridView1.Rows[i].Cells["审核员"].Value.ToString() == "__待审核")
         {
             MessageBox.Show("第" + (i + 1).ToString() + "行数据没有审核,请先审核表内数据!");
             return;
         }
     }
     checkform = new CheckForm(this);
     checkform.Show();
 }