Exemple #1
0
 void queryWhere(string strwhere)
 {
     _list = _bll.getList(strwhere);
     if (_list != null)
     {
         panel1.Enabled = true;
         setValue(_list);
     }
 }
Exemple #2
0
        private void txtCode_Click(object sender, EventArgs e)
        {
            FormPresaleRequisition from = new FormPresaleRequisition( );

            from.StartPosition = FormStartPosition.CenterParent;
            if (from.ShowDialog( ) != DialogResult.OK)
            {
                return;
            }
            FishEntity.ReceiptRecordEntity _list = from.getList;
            txtCode.Text    = _list.codeOfYu.ToString();
            txtPrice.Text   = _list.codePrice.ToString( );
            txtFreight.Text = _list.codeYunFei.ToString( );
            txtRebate.Text  = _list.codeHuiKou.ToString( );
        }
Exemple #3
0
 protected void QueryOne(string operate, string orderBy)
 {
     _rolewhere     = string.Empty;
     panel1.Enabled = true;
     if (string.IsNullOrEmpty(_where))
     {
         _rolewhere = "1=1";
     }
     else
     {
         _rolewhere = _where;
     }
     if (_list != null)
     {
         _rolewhere += " AND code " + operate + _list.code;
     }
     _list = _bll.getList(_rolewhere + orderBy);
     if (_list != null)
     {
         setValue(_list);
     }
 }
Exemple #4
0
 void getValue( )
 {
     _list                     = new FishEntity.ReceiptRecordEntity( );
     _list.Numbering           = txtNumbering.Text;
     _list.code                = txtOddNum.Text;
     _list.departName          = txtDepartMent.Text;
     _list.departNum           = txtDepartMent.ValueMember.ToString( );
     _list.date                = dtpApply.Value;
     _list.codeOfYu            = txtCode.Text;
     _list.codeYunFei          = string.IsNullOrEmpty(txtFreight.Text) == true ? 0 : Convert.ToDecimal(txtFreight.Text);
     _list.codeHuiKou          = string.IsNullOrEmpty(txtRebate.Text) == true ? 0 : Convert.ToDecimal(txtRebate.Text);
     _list.fuKuanDanWei        = txtCompany.Text;
     _list.fuKuanDanWeiId      = txtCompany.Tag == null ? string.Empty : txtCompany.Tag.ToString( );
     _list.DemaUndnit          = txtDemaUndnit.Text;
     _list.DemaUndnitId        = txtDemaUndnit.Tag == null ? string.Empty : txtDemaUndnit.Tag.ToString();
     _list.DemandSideContact   = txtDemandSideContact.Text;
     _list.DemandSideContactId = txtDemandSideContact.Tag == null ? string.Empty : txtDemandSideContact.Tag.ToString();
     _list.fuKuanZhangHao      = txtANum.Text;
     _list.codePrice           = string.IsNullOrEmpty(txtPrice.Text) == true ? 0 : Convert.ToDecimal(txtPrice.Text);
     _list.weight              = string.IsNullOrEmpty(txtWeight.Text) == true ? 0 : Convert.ToDecimal(txtWeight.Text);
     _list.price               = string.IsNullOrEmpty(txtGoodsPrice.Text) == true ? 0 : Convert.ToDecimal(txtGoodsPrice.Text);
     if (rabYuFu.Checked == true)
     {
         _list.fuKuanType = rabYuFu.Text;
     }
     else if (rabQuanKuan.Checked == true)
     {
         _list.fuKuanType = rabQuanKuan.Text;
     }
     else if (rabWeiKuan.Checked == true)
     {
         _list.fuKuanType = rabWeiKuan.Text;
     }
     else
     {
         _list.fuKuanType = string.Empty;
     }
     _list.RMB = string.IsNullOrEmpty(texRMB.Text) == true ? 0 : Convert.ToDecimal(texRMB.Text);
     if (rabGongZhang.Checked == true)
     {
         _list.fuKuanMethod = rabGongZhang.Text;
     }
     else if (rabSiZhang.Checked == true)
     {
         _list.fuKuanMethod = rabSiZhang.Text;
     }
     else if (rabChengDui.Checked == true)
     {
         _list.fuKuanMethod = rabChengDui.Text;
     }
     else if (rabXianJin.Checked == true)
     {
         _list.fuKuanMethod = rabXianJin.Text;
     }
     else if (rabQiTa.Checked == true)
     {
         _list.fuKuanMethod = rabQiTa.Text;
         _list.fuKuanOther  = texOther.Text;
     }
     else
     {
         _list.fuKuanMethod = string.Empty;
         _list.fuKuanOther  = string.Empty;
     }
     if (rabZZSFP.Checked == true)
     {
         _list.invoiceType = rabZZSFP.Text;
     }
     else if (rabPTFP.Checked == true)
     {
         _list.invoiceType = rabPTFP.Text;
     }
     else if (rabSJ.Checked == true)
     {
         _list.invoiceType = rabSJ.Text;
     }
     else
     {
         _list.invoiceType = string.Empty;
     }
     _list.fuKuandate   = dtpDate.Value;
     _list.remark       = txtRemark.Text;
     _list.createMan    = FishEntity.Variable.User.username;
     _list.modeifyMan   = FishEntity.Variable.User.username;
     _list.codeContract = txtCodeOdd.Text;
 }
Exemple #5
0
        void setValue(FishEntity.ReceiptRecordEntity _list)
        {
            txtOddNum.Text     = _list.code;
            txtDepartMent.Text = _list.departName;
            //txtDepartMent . ValueMember = _list . departNum;
            if (_list.date != null)
            {
                dtpApply.Value = _list.date;
            }
            txtCode.Text              = _list.codeOfYu;
            txtFreight.Text           = _list.codeYunFei.ToString( );
            txtRebate.Text            = _list.codeHuiKou.ToString( );
            txtCompany.Text           = _list.fuKuanDanWei;
            txtCompany.Tag            = _list.fuKuanDanWeiId;
            txtDemandSideContact.Text = _list.DemandSideContact;
            txtDemandSideContact.Tag  = _list.DemandSideContactId;
            txtDemaUndnit.Text        = _list.DemaUndnit;
            txtDemaUndnit.Tag         = _list.DemaUndnitId;
            txtANum.Text              = _list.fuKuanZhangHao;
            txtPrice.Text             = _list.codePrice.ToString( );
            txtWeight.Text            = _list.weight.ToString( );
            txtGoodsPrice.Text        = _list.price.ToString( );
            txtNumbering.Text         = _list.Numbering;
            if (_list.fuKuanType != null)
            {
                if (_list.fuKuanType.Trim( ).Equals(rabYuFu.Text))
                {
                    rabYuFu.Checked = true;
                }
                else if (_list.fuKuanType.Trim( ).Equals(rabQuanKuan.Text))
                {
                    rabQuanKuan.Checked = true;
                }
                else if (_list.fuKuanType.Trim( ).Equals(rabWeiKuan.Text))
                {
                    rabWeiKuan.Checked = true;
                }
                else
                {
                    rabYuFu.Checked = rabQuanKuan.Checked = rabWeiKuan.Checked = false;
                }
            }
            else
            {
                rabYuFu.Checked = rabQuanKuan.Checked = rabWeiKuan.Checked = false;
            }


            texRMB.Text   = _list.RMB.ToString( );
            inputRMB.Text = Utility.MoneyToRMB.ConvertSum(_list.RMB.ToString( ));

            if (_list.fuKuanMethod != null)
            {
                if (_list.fuKuanMethod.Trim( ).Equals(rabGongZhang.Text))
                {
                    rabGongZhang.Checked = true;
                }
                else if (_list.fuKuanMethod.Trim( ).Equals(rabSiZhang.Text))
                {
                    rabSiZhang.Checked = true;
                }
                else if (_list.fuKuanMethod.Trim( ).Equals(rabChengDui.Text))
                {
                    rabChengDui.Checked = true;
                }
                else if (_list.fuKuanMethod.Trim( ).Equals(rabXianJin.Text))
                {
                    rabXianJin.Checked = true;
                }
                else if (_list.fuKuanMethod.Trim( ).Equals(rabQiTa.Text))
                {
                    rabQiTa.Checked = true;
                    texOther.Text   = _list.fuKuanOther;
                }
                else
                {
                    rabGongZhang.Checked = rabSiZhang.Checked = rabChengDui.Checked = rabXianJin.Checked = rabQiTa.Checked = false;
                    texOther.Text        = string.Empty;
                }
            }
            else
            {
                rabGongZhang.Checked = rabSiZhang.Checked = rabChengDui.Checked = rabXianJin.Checked = rabQiTa.Checked = false;
                texOther.Text        = string.Empty;
            }

            if (_list.invoiceType != null)
            {
                if (_list.invoiceType.Trim( ).Equals(rabZZSFP.Text))
                {
                    rabZZSFP.Checked = true;
                }
                else if (_list.invoiceType.Trim( ).Equals(rabPTFP.Text))
                {
                    rabPTFP.Checked = true;
                }
                else if (_list.invoiceType.Trim( ).Equals(rabSJ.Text))
                {
                    rabSJ.Checked = true;
                }
                else
                {
                    rabZZSFP.Checked = rabPTFP.Checked = rabSJ.Checked = false;
                }
            }
            else
            {
                rabZZSFP.Checked = rabPTFP.Checked = rabSJ.Checked = false;
            }

            if (!string.IsNullOrEmpty(_list.fuKuandate.ToString( )))
            {
                dtpDate.Value = _list.fuKuandate;
            }
            txtRemark.Text    = _list.remark;
            txtCodeOdd.Text   = _list.codeContract;
            txtmodifyman.Text = _list.modeifyMan;
            txtcreateman.Text = _list.createMan;
        }
Exemple #6
0
        /// <summary>
        /// 编辑一条记录
        /// </summary>
        /// <param name="_list"></param>
        /// <returns></returns>
        public bool Edit(FishEntity.ReceiptRecordEntity _list)
        {
            _list.modeifyTime = getDate( );
            StringBuilder strSql = new StringBuilder( );

            strSql.Append("UPDATE t_ReceiptRecord SET ");
            strSql.Append("departNum=@departNum,");
            strSql.Append("departName=@departName,");
            strSql.Append("date=@date,");
            strSql.Append("codeOfYu=@codeOfYu,");
            strSql.Append("codePrice=@codePrice,");
            strSql.Append("codeYunFei=@codeYunFei,");
            strSql.Append("codeHuiKou=@codeHuiKou,");
            strSql.Append("fuKuanDanWeiId=@fuKuanDanWeiId,");
            strSql.Append("fuKuanDanWei=@fuKuanDanWei,");
            strSql.Append("DemaUndnit=@DemaUndnit,");
            strSql.Append("DemaUndnitId=@DemaUndnitId,");
            strSql.Append("DemandSideContact=@DemandSideContact,");
            strSql.Append("DemandSideContactId=@DemandSideContactId,");
            strSql.Append("fuKuanZhangHao=@fuKuanZhangHao,");
            strSql.Append("weight=@weight,");
            strSql.Append("price=@price,");
            strSql.Append("RMB=@RMB,");
            strSql.Append("fuKuanType=@fuKuanType,");
            strSql.Append("fuKuanMethod=@fuKuanMethod,");
            strSql.Append("fuKuanOther=@fuKuanOther,");
            strSql.Append("invoiceType=@invoiceType,");
            strSql.Append("fuKuandate=@fuKuandate,");
            strSql.Append("remark=@remark,");
            strSql.Append("modeifyTime=@modeifyTime,");
            strSql.Append("modeifyMan=@modeifyMan,");
            strSql.Append("codeContract=@codeContract ");
            strSql.Append("WHERE code=@code");
            MySqlParameter [] parameter =
            {
                new MySqlParameter("@code",                MySqlDbType.VarChar,    45),
                new MySqlParameter("@departNum",           MySqlDbType.VarChar,    45),
                new MySqlParameter("@departName",          MySqlDbType.VarChar,    45),
                new MySqlParameter("@date",                MySqlDbType.DateTime),
                new MySqlParameter("@codeOfYu",            MySqlDbType.VarChar,    45),
                new MySqlParameter("@codePrice",           MySqlDbType.Decimal,    45),
                new MySqlParameter("@codeYunFei",          MySqlDbType.Decimal,    45),
                new MySqlParameter("@codeHuiKou",          MySqlDbType.Decimal,    45),
                new MySqlParameter("@fuKuanDanWeiId",      MySqlDbType.VarChar,    45),
                new MySqlParameter("@fuKuanDanWei",        MySqlDbType.VarChar,    45),
                new MySqlParameter("@fuKuanZhangHao",      MySqlDbType.VarChar,    45),
                new MySqlParameter("@weight",              MySqlDbType.Decimal,    45),
                new MySqlParameter("@price",               MySqlDbType.Decimal,    45),
                new MySqlParameter("@RMB",                 MySqlDbType.Decimal,    45),
                new MySqlParameter("@fuKuanType",          MySqlDbType.VarChar,    45),
                new MySqlParameter("@fuKuanMethod",        MySqlDbType.VarChar,    45),
                new MySqlParameter("@fuKuanOther",         MySqlDbType.VarChar,    45),
                new MySqlParameter("@invoiceType",         MySqlDbType.VarChar,    45),
                new MySqlParameter("@fuKuandate",          MySqlDbType.Date),
                new MySqlParameter("@remark",              MySqlDbType.VarChar,   500),
                new MySqlParameter("@createTime",          MySqlDbType.DateTime),
                new MySqlParameter("@createMan",           MySqlDbType.VarChar,    45),
                new MySqlParameter("@modeifyTime",         MySqlDbType.DateTime),
                new MySqlParameter("@modeifyMan",          MySqlDbType.VarChar,    45),
                new MySqlParameter("@codeContract",        MySqlDbType.VarChar,   200),
                new MySqlParameter("@DemaUndnit",          MySqlDbType.VarChar,   100),
                new MySqlParameter("@DemaUndnitId",        MySqlDbType.VarChar,   100),
                new MySqlParameter("@DemandSideContact",   MySqlDbType.VarChar,   100),
                new MySqlParameter("@DemandSideContactId", MySqlDbType.VarChar, 100)
            };
            parameter [0].Value  = _list.code;
            parameter [1].Value  = _list.departNum;
            parameter [2].Value  = _list.departName;
            parameter [3].Value  = _list.date;
            parameter [4].Value  = _list.codeOfYu;
            parameter [5].Value  = _list.codePrice;
            parameter [6].Value  = _list.codeYunFei;
            parameter [7].Value  = _list.codeHuiKou;
            parameter [8].Value  = _list.fuKuanDanWeiId;
            parameter [9].Value  = _list.fuKuanDanWei;
            parameter [10].Value = _list.fuKuanZhangHao;
            parameter [11].Value = _list.weight;
            parameter [12].Value = _list.price;
            parameter [13].Value = _list.RMB;
            parameter [14].Value = _list.fuKuanType;
            parameter [15].Value = _list.fuKuanMethod;
            parameter [16].Value = _list.fuKuanOther;
            parameter [17].Value = _list.invoiceType;
            parameter [18].Value = _list.fuKuandate;
            parameter [19].Value = _list.remark;
            parameter [20].Value = _list.createTime;
            parameter [21].Value = _list.createMan;
            parameter [22].Value = _list.modeifyTime;
            parameter [23].Value = _list.modeifyMan;
            parameter [24].Value = _list.codeContract;
            parameter[25].Value  = _list.DemaUndnit;
            parameter[26].Value  = _list.DemaUndnitId;
            parameter[27].Value  = _list.DemandSideContact;
            parameter[28].Value  = _list.DemandSideContactId;
            int row = MySqlHelper.ExecuteSql(strSql.ToString( ), parameter);

            if (row > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #7
0
        /// <summary>
        /// 增加一条记录
        /// </summary>
        /// <param name="_list"></param>
        /// <returns></returns>
        public bool Add(FishEntity.ReceiptRecordEntity _list)
        {
            _list.createTime = _list.modeifyTime = getDate( );
            StringBuilder strSql = new StringBuilder( );

            strSql.Append("INSERT INTO t_ReceiptRecord (");
            strSql.Append("Numbering,code,departNum,departName,date,codeOfYu,codePrice,codeYunFei,codeHuiKou,fuKuanDanWeiId,fuKuanDanWei,DemaUndnit,DemaUndnitId,DemandSideContact,DemandSideContactId,fuKuanZhangHao,weight,price,RMB,fuKuanType,fuKuanMethod,fuKuanOther ,invoiceType ,fuKuandate ,remark ,createTime ,createMan ,modeifyTime ,modeifyMan,codeContract) ");
            strSql.Append("VALUES (");
            strSql.Append("@Numbering,@code,@departNum,@departName,@date,@codeOfYu,@codePrice,@codeYunFei,@codeHuiKou,@fuKuanDanWeiId,@fuKuanDanWei,@DemaUndnit,@DemaUndnitId,@DemandSideContact,@DemandSideContactId,@fuKuanZhangHao,@weight,@price,@RMB,@fuKuanType,@fuKuanMethod,@fuKuanOther ,@invoiceType ,@fuKuandate ,@remark ,@createTime ,@createMan ,@modeifyTime ,@modeifyMan,@codeContract)");
            MySqlParameter [] parameter =
            {
                new MySqlParameter("@code",                MySqlDbType.VarChar,    45),
                new MySqlParameter("@departNum",           MySqlDbType.VarChar,    45),
                new MySqlParameter("@departName",          MySqlDbType.VarChar,    45),
                new MySqlParameter("@date",                MySqlDbType.DateTime),
                new MySqlParameter("@codeOfYu",            MySqlDbType.VarChar,    45),
                new MySqlParameter("@codePrice",           MySqlDbType.Decimal,    45),
                new MySqlParameter("@codeYunFei",          MySqlDbType.Decimal,    45),
                new MySqlParameter("@codeHuiKou",          MySqlDbType.Decimal,    45),
                new MySqlParameter("@fuKuanDanWeiId",      MySqlDbType.VarChar,    45),
                new MySqlParameter("@fuKuanDanWei",        MySqlDbType.VarChar,    45),
                new MySqlParameter("@fuKuanZhangHao",      MySqlDbType.VarChar,    45),
                new MySqlParameter("@weight",              MySqlDbType.Decimal,    45),
                new MySqlParameter("@price",               MySqlDbType.Decimal,    45),
                new MySqlParameter("@RMB",                 MySqlDbType.Decimal,    45),
                new MySqlParameter("@fuKuanType",          MySqlDbType.VarChar,    45),
                new MySqlParameter("@fuKuanMethod",        MySqlDbType.VarChar,    45),
                new MySqlParameter("@fuKuanOther",         MySqlDbType.VarChar,    45),
                new MySqlParameter("@invoiceType",         MySqlDbType.VarChar,    45),
                new MySqlParameter("@fuKuandate",          MySqlDbType.Date),
                new MySqlParameter("@remark",              MySqlDbType.VarChar,   500),
                new MySqlParameter("@createTime",          MySqlDbType.DateTime),
                new MySqlParameter("@createMan",           MySqlDbType.VarChar,    45),
                new MySqlParameter("@modeifyTime",         MySqlDbType.DateTime),
                new MySqlParameter("@modeifyMan",          MySqlDbType.VarChar,    45),
                new MySqlParameter("@codeContract",        MySqlDbType.VarChar,   200),
                new MySqlParameter("@DemaUndnit",          MySqlDbType.VarChar,   100),
                new MySqlParameter("@DemaUndnitId",        MySqlDbType.VarChar,   100),
                new MySqlParameter("@DemandSideContact",   MySqlDbType.VarChar,   100),
                new MySqlParameter("@DemandSideContactId", MySqlDbType.VarChar,   100),
                new MySqlParameter("@Numbering",           MySqlDbType.VarChar, 45)
            };
            parameter [0].Value  = _list.code;
            parameter [1].Value  = _list.departNum;
            parameter [2].Value  = _list.departName;
            parameter [3].Value  = _list.date;
            parameter [4].Value  = _list.codeOfYu;
            parameter [5].Value  = _list.codePrice;
            parameter [6].Value  = _list.codeYunFei;
            parameter [7].Value  = _list.codeHuiKou;
            parameter [8].Value  = _list.fuKuanDanWeiId;
            parameter [9].Value  = _list.fuKuanDanWei;
            parameter [10].Value = _list.fuKuanZhangHao;
            parameter [11].Value = _list.weight;
            parameter [12].Value = _list.price;
            parameter [13].Value = _list.RMB;
            parameter [14].Value = _list.fuKuanType;
            parameter [15].Value = _list.fuKuanMethod;
            parameter [16].Value = _list.fuKuanOther;
            parameter [17].Value = _list.invoiceType;
            parameter [18].Value = _list.fuKuandate;
            parameter [19].Value = _list.remark;
            parameter [20].Value = _list.createTime;
            parameter [21].Value = _list.createMan;
            parameter [22].Value = _list.modeifyTime;
            parameter [23].Value = _list.modeifyMan;
            parameter [24].Value = _list.codeContract;
            parameter[25].Value  = _list.DemaUndnit;
            parameter[26].Value  = _list.DemaUndnitId;
            parameter[27].Value  = _list.DemandSideContact;
            parameter[28].Value  = _list.DemandSideContactId;
            parameter[29].Value  = _list.Numbering;
            int row = MySqlHelper.ExecuteSql(strSql.ToString( ), parameter);

            if (row > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #8
0
        public FishEntity.ReceiptRecordEntity GetDataRow(DataRow row)
        {
            FishEntity.ReceiptRecordEntity _model = new FishEntity.ReceiptRecordEntity( );

            if (row != null)
            {
                if (row["Numbering"] != null)
                {
                    _model.Numbering = row["Numbering"].ToString();
                }
                if (row ["code"] != null && row ["code"].ToString( ) != "")
                {
                    _model.code = row ["code"].ToString( );
                }
                if (row ["departNum"] != null && row ["departNum"].ToString( ) != "")
                {
                    _model.departNum = row ["departNum"].ToString( );
                }
                if (row ["departName"] != null && row ["departName"].ToString( ) != "")
                {
                    _model.departName = row ["departName"].ToString( );
                }
                if (row ["date"] != null && row ["date"].ToString( ) != "")
                {
                    _model.date = DateTime.Parse(row ["date"].ToString( ));
                }
                if (row ["codeOfYu"] != null && row ["codeOfYu"].ToString( ) != "")
                {
                    _model.codeOfYu = row ["codeOfYu"].ToString( );
                }
                if (row ["codePrice"] != null && row ["codePrice"].ToString( ) != "")
                {
                    _model.codePrice = decimal.Parse(row ["codePrice"].ToString( ));
                }
                if (row ["codeYunFei"] != null && row ["codeYunFei"].ToString( ) != "")
                {
                    _model.codeYunFei = decimal.Parse(row ["codeYunFei"].ToString( ));
                }
                if (row ["codeHuiKou"] != null && row ["codeHuiKou"].ToString( ) != "")
                {
                    _model.codeHuiKou = decimal.Parse(row ["codeHuiKou"].ToString( ));
                }
                if (row ["fuKuanDanWeiId"] != null)
                {
                    _model.fuKuanDanWeiId = row ["fuKuanDanWeiId"].ToString( );
                }
                if (row ["fuKuanDanWei"] != null && row ["fuKuanDanWei"].ToString( ) != "")
                {
                    _model.fuKuanDanWei = row ["fuKuanDanWei"].ToString( );
                }
                if (row["DemaUndnit"] != null && row["DemaUndnit"].ToString() != "")
                {
                    _model.DemaUndnit = row["DemaUndnit"].ToString();
                }
                if (row["DemaUndnitId"] != null)
                {
                    _model.DemaUndnitId = row["DemaUndnitId"].ToString();
                }
                if (row["DemandSideContact"] != null && row["DemandSideContact"].ToString() != "")
                {
                    _model.DemandSideContact = row["DemandSideContact"].ToString();
                }
                if (row["DemandSideContactId"] != null)
                {
                    _model.DemandSideContactId = row["DemandSideContactId"].ToString();
                }
                if (row ["fuKuanZhangHao"] != null && row ["fuKuanZhangHao"].ToString( ) != "")
                {
                    _model.fuKuanZhangHao = row ["fuKuanZhangHao"].ToString( );
                }
                if (row ["weight"] != null && row ["weight"].ToString( ) != "")
                {
                    _model.weight = decimal.Parse(row ["weight"].ToString( ));
                }
                if (row ["price"] != null && row ["price"].ToString( ) != "")
                {
                    _model.price = decimal.Parse(row ["price"].ToString( ));
                }
                if (row ["RMB"] != null && row ["RMB"].ToString( ) != "")
                {
                    _model.RMB = decimal.Parse(row ["RMB"].ToString( ));
                }
                if (row ["fuKuanType"] != null && row ["fuKuanType"].ToString( ) != "")
                {
                    _model.fuKuanType = row ["fuKuanType"].ToString( );
                }
                if (row ["fuKuanMethod"] != null && row ["fuKuanMethod"].ToString( ) != "")
                {
                    _model.fuKuanMethod = row ["fuKuanMethod"].ToString( );
                }
                if (row ["fuKuanOther"] != null && row ["fuKuanOther"].ToString( ) != "")
                {
                    _model.fuKuanOther = row ["fuKuanOther"].ToString( );
                }
                if (row ["invoiceType"] != null && row ["invoiceType"].ToString( ) != "")
                {
                    _model.invoiceType = row ["invoiceType"].ToString( );
                }
                if (row ["fuKuandate"] != null && row ["fuKuandate"].ToString( ) != "")
                {
                    _model.fuKuandate = DateTime.Parse(row ["fuKuandate"].ToString( ));
                }
                if (row ["remark"] != null && row ["remark"].ToString( ) != "")
                {
                    _model.remark = row ["remark"].ToString( );
                }
                if (row ["codeContract"] != null && row ["codeContract"].ToString( ) != "")
                {
                    _model.codeContract = row ["codeContract"].ToString( );
                }
                if (row["modeifyMan"] != null)
                {
                    _model.modeifyMan = row["modeifyMan"].ToString();
                }
                if (row["createMan"] != null)
                {
                    _model.createMan = row["createMan"].ToString();
                }
            }

            return(_model);
        }
Exemple #9
0
 /// <summary>
 /// 编辑一条记录
 /// </summary>
 /// <param name="_list"></param>
 /// <returns></returns>
 public bool Edit(FishEntity.ReceiptRecordEntity _list)
 {
     return(dal.Edit(_list));
 }
Exemple #10
0
 /// <summary>
 /// 增加一条记录
 /// </summary>
 /// <param name="_list"></param>
 /// <returns></returns>
 public bool Add(FishEntity.ReceiptRecordEntity _list)
 {
     return(dal.Add(_list));
 }
Exemple #11
0
        //
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex < 0 || e.RowIndex < 0)
            {
                return;
            }
            if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("yfId", StringComparison.OrdinalIgnoreCase) == true)
            {
                FormSetPresaleRequisiton from   = new FormSetPresaleRequisiton("预售采购申请单鱼粉查询");
                DialogResult             result = from.ShowDialog( );
                if (result == DialogResult.OK)
                {
                    bool isOk = true;
                    FishEntity.ProductEntity _model = from.getPerson;
                    for (int i = 0; i < dataGridView1.Rows.Count - 1; i++)
                    {
                        if (!string.IsNullOrEmpty(dataGridView1.Rows [i].Cells ["yfId"].Value.ToString( )) && dataGridView1.Rows [i].Cells ["yfId"].Value.ToString( ) == _model.code)
                        {
                            if (i != e.RowIndex)
                            {
                                isOk = false;
                                break;
                            }
                        }
                    }
                    if (isOk == false)
                    {
                        return;
                    }
                    dataGridView1.Rows [e.RowIndex].Cells ["yfId"].Value        = _model.code;
                    dataGridView1.Rows [e.RowIndex].Cells ["yfName"].Value      = _model.name;
                    dataGridView1.Rows [e.RowIndex].Cells ["yfVarieties"].Value = _model.specification;
                    dataGridView1.Rows [e.RowIndex].Cells ["yfUnit"].Value      = _model.nature + _model.specification;

                    dataGridView2.Rows[e.RowIndex].Cells["yfdb"].Value  = _model.sgs_protein;
                    dataGridView2.Rows[e.RowIndex].Cells["yftvn"].Value = _model.sgs_tvn;
                    //dataGridView2.Rows[e.RowIndex].Cells["sgs_graypart"].Value = _model.sgs_graypart;
                    dataGridView2.Rows[e.RowIndex].Cells["yfshy"].Value = _model.sgs_sandsalt;
                    dataGridView2.Rows[e.RowIndex].Cells["yfza"].Value  = _model.sgs_amine;
                    dataGridView2.Rows[e.RowIndex].Cells["yfffa"].Value = _model.sgs_ffa;
                    dataGridView2.Rows[e.RowIndex].Cells["yfzf"].Value  = _model.sgs_fat;
                    dataGridView2.Rows[e.RowIndex].Cells["yfsf"].Value  = _model.sgs_water;
                    dataGridView2.Rows[e.RowIndex].Cells["yfs"].Value   = _model.sgs_sand;

                    dataGridView2.Rows [e.RowIndex].Cells ["yfId_one"].Value = _model.code;

                    dataGridView3.Rows [e.RowIndex].Cells ["yfId_tre"].Value = _model.code;

                    dataGridView4.Rows [e.RowIndex].Cells ["yfId_for"].Value = _model.code;
                    //dataGridView4 . Rows [ e . RowIndex ] . Cells [ "yfpp" ] . Value = _model . brand;
                }
            }

            if (dataGridView1.Columns [e.ColumnIndex].Name.Equals("yfName", StringComparison.OrdinalIgnoreCase) == true)
            {
                _list             = new FishEntity.ReceiptRecordEntity( );
                _list.codeHuiKou  = string.IsNullOrEmpty(texrebate.Text) == true ? 0 : Convert.ToDecimal(texrebate.Text);
                _list.codeOfYu    = txtcode.Text;
                _list.codePrice   = string.IsNullOrEmpty(dataGridView1.Rows [e.RowIndex].Cells ["yfPrice"].Value.ToString( )) == true ? 0 : Convert.ToDecimal(dataGridView1.Rows [e.RowIndex].Cells ["yfPrice"].Value.ToString( ));
                _list.codeYunFei  = string.IsNullOrEmpty(texFreight.Text) == true ? 0 : Convert.ToDecimal(texFreight.Text);
                this.DialogResult = DialogResult.OK;
            }
        }