コード例 #1
0
 public override void Review()
 {
     Review(this.Name, txtNumbering.Text, txtcode.Text);
     if (txtNumbering.Text != "")
     {
         _Refreshbll = new FishBll.Bll.ProcessStateBll();
         _Refreshbll.GetFormBilloflading(txtNumbering.Text);
     }
     base.Review();
 }
コード例 #2
0
        public override int Modify()
        {
            if (string.IsNullOrEmpty(txtCodeOdd.Text))
            {
                MessageBox.Show("请选择销售合同号");
                return(0);
            }
            _fish.Contactsunit   = txtcontactsunit.Text.ToString();
            _fish.ContactsunitId = txtcontactsunit.Tag.ToString();
            _fish.Issuingtime    = dtpIssuingtime.Value;
            _fish.Warehouse      = txtwarehouse.Text.ToString();
            _fish.Species        = cmbspecies.SelectedValue == null ? string.Empty : cmbspecies.SelectedValue.ToString();
            _fish.Specification  = cmbspecification.SelectedValue == null ? string.Empty : cmbspecification.SelectedValue.ToString();
            _fish.Ferryname      = txtferryname.Text.ToString();
            _fish.Listname       = txtlistname.Text.ToString();
            _fish.Cornerno       = txtcornerno.Text.ToString();
            _fish.Ton            = txtTon.Text;
            _fish.Packagenumber  = txtpackagenumber.Text;
            _fish.Remarks        = txtRemarks.Text.ToString();
            _fish.SerialNumber   = txtSerialNumber.Text;
            _fish.ShipNotice     = txtShipNotice.Text.ToString();
            _fish.Storagecosts   = txtStoragecosts.Text;
            _fish.Modifytime     = DateTime.Now;
            _fish.Modifyman      = FishEntity.Variable.User.username;
            _fish.codeContract   = txtCodeOdd.Text.ToString();
            _fish.Recipient      = txtRecipient.Text.ToString();
            FishBll.Bll.BillofladingBll bll = new FishBll.Bll.BillofladingBll();
            if (bll.ExistsUpdate(_fish.Code, FishEntity.Variable.User.username) != true)
            {
                MessageBox.Show("不是所属人无法操作!");
                return(0);
            }
            bool isOk = bll.Update(_fish);

            AddImages(_fish);
            if (isOk)
            {
                if (txtNumbering.Text != "")
                {
                    _Refreshbll = new FishBll.Bll.ProcessStateBll();
                    _Refreshbll.GetFormBilloflading(txtNumbering.Text);
                }
                MessageBox.Show("修改成功。");
            }
            else
            {
                MessageBox.Show("修改失败。");
            }
            return(1);
        }
コード例 #3
0
        public override int Query()
        {
            try
            {
                if (!string.IsNullOrEmpty(comNumbering.Text))
                {
                    _bll.GetFormSalesRequisition(comNumbering.Text);
                    _bll.GetFormSalesRContract(comNumbering.Text);
                    _bll.GetFormPaymentRequisition(comNumbering.Text);
                    _bll.GetFormBilloflading(comNumbering.Text);
                    _bll.GetFormOnepound(comNumbering.Text);
                    _bll.GetFormCargoFeedbackSheet(comNumbering.Text);
                    _bll.GetFormTheproblemsheet(comNumbering.Text);
                    _bll.GetFormReceiptRecord(comNumbering.Text);
                }
            }
            catch (Exception ex)
            {
                Utility.LogHelper.WriteLog(ex.StackTrace);
                Utility.LogHelper.WriteLog(ex.Message);
            }
            finally
            {
                string strWhere = "1=1";
                if (!string.IsNullOrEmpty(comNumbering.Text))
                {
                    strWhere = strWhere + " and a.Numbering='" + comNumbering.Text + "'";
                }
                if (!string.IsNullOrEmpty(txtdemand.Text))
                {
                    strWhere = strWhere + " and b.demand like '%" + txtdemand.Text + "%' ";
                }
                if (!string.IsNullOrEmpty(txtPurchasecontractnumber.Text))
                {
                    strWhere = strWhere + " and b.Purchasecontractnumber like '%" + txtPurchasecontractnumber.Text + "%' ";
                }
                if (!string.IsNullOrEmpty(dtpStart.Text.Trim()))
                {
                    strWhere = strWhere + " AND b.Signdate>='" + dtpStart.Text + "'";
                }
                if (!string.IsNullOrEmpty(txtCode.Text.Trim()))
                {
                    strWhere = strWhere + " AND b.code like'%" + txtCode.Text + "%'";
                }
                if (!string.IsNullOrEmpty(dtpEnd.Text.Trim()))
                {
                    strWhere = strWhere + " AND b.Signdate<='" + dtpEnd.Text + "'";
                }
                if (FishEntity.Variable.User.roletype.Equals(FishEntity.Constant.Role_SalesMan))
                {
                    strWhere += string.Format(" and b.createman='{0}' ", FishEntity.Variable.User.username);
                }
                else
                {
                    if (cmbTheperson.SelectedValue.ToString() != " ")
                    {
                        strWhere += string.Format(" and b.createman='{0}' ", cmbTheperson.SelectedValue.ToString());
                    }
                }
                switch (cmbeffect.SelectedItem.ToString())
                {
                case "有效": strWhere += string.Format(" and effect IS NULL", cmbeffect.SelectedItem.ToString()); break;

                case "无效": strWhere += string.Format(" and effect like '%{0}%'", cmbeffect.SelectedItem.ToString()); break;

                case "全部":
                default: break;
                }
                i = 0;
                List <FishEntity.ProcessStateEntity> modelList = _bll.getList(strWhere);
                if (modelList != null)
                {
                    dataGridView1.Rows.Clear();
                    foreach (FishEntity.ProcessStateEntity _list in modelList)
                    {
                        getValue(i, _list);
                        i++;
                    }
                }
                else
                {
                    MessageBox.Show("查无数据!");
                }
            }

            return(base.Query());
        }
コード例 #4
0
        public override void Save()
        {
            FishEntity.BillofladingEntity _fish = new FishEntity.BillofladingEntity();
            if (string.IsNullOrEmpty(txtcontactsunit.Text) == false)
            {
                _fish.Contactsunit = txtcontactsunit.Text.Trim().ToString();
            }
            else
            {
                MessageBox.Show("请选择提货单位。");
                return;
            }
            if (string.IsNullOrEmpty(txtCodeOdd.Text))
            {
                MessageBox.Show("请选择销售合同号");
                return;
            }
            _fish.Code           = FishBll.Bll.SequenceUtil.GetBillofladingnumber();
            _fish.ContactsunitId = txtcontactsunit.Tag.ToString();
            _fish.Issuingtime    = dtpIssuingtime.Value;
            _fish.Warehouse      = txtwarehouse.Text.ToString();
            _fish.Species        = cmbspecies.SelectedValue == null ? string.Empty : cmbspecies.SelectedValue.ToString();
            _fish.Specification  = cmbspecification.SelectedValue == null ? string.Empty : cmbspecification.SelectedValue.ToString();
            _fish.Ferryname      = txtferryname.Text.ToString();
            _fish.Listname       = txtlistname.Text.ToString();
            _fish.Cornerno       = txtcornerno.Text.ToString();
            _fish.Ton            = txtTon.Text;
            _fish.Packagenumber  = txtpackagenumber.Text;
            _fish.Remarks        = txtRemarks.Text.ToString().Trim();
            _fish.SerialNumber   = txtSerialNumber.Text.ToString();
            _fish.ShipNotice     = txtShipNotice.Text.ToString().Trim();
            _fish.Storagecosts   = txtStoragecosts.Text;
            _fish.Createtime     = DateTime.Now;
            _fish.Createman      = FishEntity.Variable.User.username;
            _fish.Modifytime     = DateTime.Now;
            _fish.Modifyman      = _fish.Createman;
            _fish.codeContract   = txtCodeOdd.Text;
            _fish.Recipient      = txtRecipient.Text;
            _fish.Numbering      = txtNumbering.Text;
            FishBll.Bll.BillofladingBll bll = new FishBll.Bll.BillofladingBll();
            bool isok = bll.Exists(_fish.Code);

            while (isok)
            {
                _fish.Code = FishBll.Bll.SequenceUtil.GetBillofladingnumber();
                isok       = bll.Exists(_fish.Code);
            }
            int id = bll.Add(_fish);

            if (id > 0)
            {
                if (txtNumbering.Text != "")
                {
                    _Refreshbll = new FishBll.Bll.ProcessStateBll();
                    _Refreshbll.GetFormBilloflading(txtNumbering.Text);
                }
                _fish.Id = id;
                AddImages(_fish);
                tmiQuery.Visible  = false;
                tmiDelete.Visible = false;
                tmiModify.Visible = true;
                tmiAdd.Visible    = false;
                tmiSave.Visible   = false;
                tmiCancel.Visible = true;
                MessageBox.Show("添加成功。");
                txtcode.Text = _fish.Code;
            }
            else
            {
                txtcode.Text = _fish.Code;
                MessageBox.Show("添加失败。");
            }
        }