Пример #1
0
        public FormQuote()
        {
            InitializeComponent();
            ReadColumnConfig(dataGridView1, "Set_Quote");
            dtpStart.Value = DateTime.Now.AddYears(-1);
            dtpEnd.Value   = DateTime.Now.AddYears(1);

            UIControls.ToolStripMenuItemEx tmiQuoteImage = new UIControls.ToolStripMenuItemEx();
            tmiQuoteImage.Text    = "报盘附件";
            tmiQuoteImage.FunCode = "50";
            tmiQuoteImage.Click  += tmiQuoteImage_Click;
            menuStrip1.Items.Insert(menuStrip1.Items.IndexOf(tmiClose), tmiQuoteImage);

            UIControls.ToolStripMenuItemEx tmiAddFish = new UIControls.ToolStripMenuItemEx();
            tmiAddFish.Text    = "新增鱼粉";
            tmiAddFish.FunCode = "51";
            tmiAddFish.Click  += tmiAddFish_Click;
            menuStrip1.Items.Insert(menuStrip1.Items.IndexOf(tmiClose), tmiAddFish);

            FishEntity.SystemDataType        item = new FishEntity.SystemDataType(string.Empty, string.Empty);
            List <FishEntity.SystemDataType> list = FishEntity.Variable.ProductDataTypeList.GetRange(0, FishEntity.Variable.ProductDataTypeList.Count);

            list.Insert(0, item);
            cmbCountry.DataSource    = list;
            cmbCountry.DisplayMember = "name";
            cmbCountry.ValueMember   = "code";
            InitDataUtil.BindComboBoxData(cmbCountry, FishEntity.Constant.CountryType, true);//
            InitDataUtil.BindComboBoxData(cmbPZ, FishEntity.Constant.Specification, true);
            InitDataUtil.BindComboBoxData(cmbPort, FishEntity.Constant.port, true);

            DealDataGridViewHeader();
        }
Пример #2
0
        protected void InitDataGridViewColumns()
        {
            dataGridView1.Columns.Clear();
            if (FishEntity.Variable.ProductDataTypeList == null)
            {
                return;
            }
            FishEntity.SystemDataType checkType = FishEntity.Variable.ProductDataTypeList.Find((i) => { return(i.Code == FishEntity.Constant.CheckItem); });
            if (checkType == null)
            {
                return;
            }

            FishBll.Bll.DictBll bll = new FishBll.Bll.DictBll();
            _columns = bll.GetModelList(string.Format(" isdelete=0 and issystem=0 and pcode='{0}' order by pcode asc,orderid asc", checkType.Code));
            if (_columns == null || _columns.Count < 1)
            {
                return;
            }

            try
            {
                DataGridViewColumn col = null;

                foreach (FishEntity.DictEntity item in _columns)
                {
                    col            = new DataGridViewTextBoxColumn();
                    col.HeaderText = item.name;
                    col.Name       = item.code;
                    col.Width      = 80;
                    dataGridView1.Columns.Add(col);

                    col            = new DataGridViewTextBoxColumn();
                    col.HeaderText = item.name + "_id";
                    col.Name       = item.code + "_id";
                    col.Visible    = false;
                    dataGridView1.Columns.Add(col);
                }

                col            = new DataGridViewTextBoxColumn();
                col.Name       = "id";
                col.HeaderText = "id";
                dataGridView1.Columns.Add(col);
                col.Visible = false;

                col            = new DataGridViewTextBoxColumn();
                col.Name       = "line";
                col.HeaderText = "line";
                col.Visible    = false;
                dataGridView1.Columns.Add(col);
            }
            catch (Exception ex)
            {
                string msg = ex.Message;
            }
        }
Пример #3
0
        public FormSelfMake()
        {
            InitializeComponent();
            ReadColumnConfig(dataGridView1, "Set_SelfMake");
            //tmiModify.Visible = false;
            //tmiDelete.Visible = false;
            //tmiPrevious.Visible = false;
            //tmiNext.Visible = false;
            //tmiSave.Visible = false;
            //tmiCancel.Visible = false;
            //tmiAdd.Visible = false;
            //tmiExport.Visible = false;
            //USER-GFH6FVIQL8
            dtpStart.Value = DateTime.Now.AddYears(-1);
            dtpEnd.Value   = DateTime.Now.AddYears(1);

            UIControls.ToolStripMenuItemEx tmiQuoteImage = new UIControls.ToolStripMenuItemEx();
            tmiQuoteImage.Text    = "报盘附件";
            tmiQuoteImage.FunCode = "50";
            tmiQuoteImage.Click  += tmiQuoteImage_Click;
            menuStrip1.Items.Insert(menuStrip1.Items.IndexOf(tmiClose), tmiQuoteImage);

            UIControls.ToolStripMenuItemEx tmiAddFish = new UIControls.ToolStripMenuItemEx();
            tmiAddFish.Text    = "新增鱼粉";
            tmiAddFish.FunCode = "51";
            tmiAddFish.Click  += tmiAddFish_Click;
            menuStrip1.Items.Insert(menuStrip1.Items.IndexOf(tmiClose), tmiAddFish);

            FishEntity.SystemDataType        item = new FishEntity.SystemDataType(string.Empty, string.Empty);
            List <FishEntity.SystemDataType> list = FishEntity.Variable.StateList.GetRange(0, FishEntity.Variable.StateList.Count);

            list.Insert(0, item);
            cmbCountry.DataSource    = list;
            cmbCountry.DisplayMember = "name";
            cmbCountry.ValueMember   = "code";
            InitDataUtil.BindComboBoxData(cmbCountry, FishEntity.Constant.CountryType, true);//
            InitDataUtil.BindComboBoxData(cmbPZ, FishEntity.Constant.Specification, true);
            InitDataUtil.BindComboBoxData(cmbPort, FishEntity.Constant.port, true);
            DealDataGridViewHeader();

            if (FishEntity.Variable.User.username == "admin" || FishEntity.Variable.User.username == "ceo" || FishEntity.Variable.User.username == "zd_lyk")
            {
                this.dataGridView1.ReadOnly = false;
            }
            else
            {
                this.dataGridView1.ReadOnly = true;
            }
        }
Пример #4
0
        public FormSaleRecordReport()
        {
            InitializeComponent();
            ReadColumnConfig(dataGridView1, "Set_SaleRecordReport");
            FishEntity.SystemDataType        item = new FishEntity.SystemDataType(string.Empty, string.Empty);
            List <FishEntity.SystemDataType> list = FishEntity.Variable.ProductDataTypeList.GetRange(0, FishEntity.Variable.ProductDataTypeList.Count);

            list.Insert(0, item);
            cmbCountry.DataSource    = list;
            cmbCountry.DisplayMember = "name";
            cmbCountry.ValueMember   = "code";
            InitDataUtil.BindComboBoxData(cmbCountry, FishEntity.Constant.CountryType, true);//
            InitDataUtil.BindComboBoxData(cmbPZ, FishEntity.Constant.Specification, true);
            //dtpStart.Value = DateTime.Now.AddYears(-1);
            //dtpEnd.Value = DateTime.Now.AddYears(1);
        }
Пример #5
0
        public FormNewFinish()
        {
            InitializeComponent();

            ReadColumnConfig(dataGridView1, "Set_chengpin");
            FishEntity.SystemDataType        item = new FishEntity.SystemDataType(string.Empty, string.Empty);
            List <FishEntity.SystemDataType> list = FishEntity.Variable.StateList.GetRange(0, FishEntity.Variable.StateList.Count);

            list.Insert(0, item);
            cmbCountry.DataSource    = list;
            cmbCountry.DisplayMember = "name";
            cmbCountry.ValueMember   = "code";
            InitDataUtil.BindComboBoxData(cmbCountry, FishEntity.Constant.CountryType, true);//
            dtpStart.Value = DateTime.Now.AddYears(-1);
            dtpEnd.Value   = DateTime.Now.AddYears(1);
            DealDataGridViewHeader();
        }
Пример #6
0
        private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {
            if (e.ColumnIndex < 0 || e.RowIndex < 0)
            {
                return;
            }

            if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("type"))
            {
                if (e.Value == null)
                {
                    return;
                }
                string type = e.Value.ToString();
                FishEntity.SystemDataType item = FishEntity.Variable.SystemDataTypeList.Find((i) => { return(i.Code.Equals(type)); });
                if (item != null)
                {
                    e.Value = item.Name;
                }
            }
        }
Пример #7
0
        public FormFishCondition()
        {
            InitializeComponent();


            FishEntity.SystemDataType        item = new FishEntity.SystemDataType(string.Empty, string.Empty);
            List <FishEntity.SystemDataType> list = FishEntity.Variable.StateList.GetRange(0, FishEntity.Variable.StateList.Count);

            list.Insert(0, item);
            cmbState.DataSource    = list;
            cmbState.DisplayMember = "name";
            cmbState.ValueMember   = "name";

            InitDataUtil.BindComboBoxData(cmbBand, FishEntity.Constant.Brand, true);
            InitDataUtil.BindComboBoxData(cmbCountry, FishEntity.Constant.CountryType, true);
            InitDataUtil.BindComboBoxData(cmbFishType, FishEntity.Constant.FishClass, true);
            InitDataUtil.BindComboBoxData(cmborigin, FishEntity.Constant.Origin, true);
            InitDataUtil.BindComboBoxData(cmbTechClass, FishEntity.Constant.TechClass, true);
            InitDataUtil.BindComboBoxData(cmbProvince, FishEntity.Constant.Province, true);
            this.SetButtomImage(btnQuery);
        }
        protected FishEntity.SelfStorageFlowingReportVo DataRowToVo(DataRow row)
        {
            FishEntity.SelfStorageFlowingReportVo vo = new FishEntity.SelfStorageFlowingReportVo();

            if (row["agentifcompany"] != null)
            {
                vo.agentifcompany = row["agentifcompany"].ToString();
            }
            if (row["arriveportdate"] != null)
            {
                vo.arriveportdate = row["arriveportdate"].ToString();
            }
            if (row["billcode"] != null)
            {
                vo.billcode = row["billcode"].ToString();
            }
            if (row["billtype"] != null)
            {
                vo.billtype = row["billtype"].ToString();
            }

            if (row["brand"] != null)
            {
                vo.brand = row["brand"].ToString();
            }
            if (row["customsofcompany"] != null)
            {
                vo.customsofcompany = row["customsofcompany"].ToString();
            }

            if (row["date"] != null && row["date"].ToString() != "")
            {
                vo.date = DateTime.Parse(row["date"].ToString());
            }

            if (row["nature"] != null)
            {
                vo.nature = row["nature"].ToString();
            }
            if (row["ownername"] != null)
            {
                vo.ownername = row["ownername"].ToString();
            }

            if (row["productcode"] != null)
            {
                vo.productcode = row["productcode"].ToString();
            }

            if (row["productid"] != null && row["productid"].ToString() != "")
            {
                vo.productid = int.Parse(row["productid"].ToString());
            }
            if (row["productname"] != null)
            {
                vo.productname = row["productname"].ToString();
            }

            if (row["sgs_amine"] != null && row["sgs_amine"].ToString() != "")//
            {
                vo.sgs_amine = decimal.Parse(row["sgs_amine"].ToString());
            }
            if (row["sgs_protein"] != null && row["sgs_protein"].ToString() != "")
            {
                vo.sgs_protein = decimal.Parse(row["sgs_protein"].ToString());
            }
            if (row["sgs_tvn"] != null && row["sgs_tvn"].ToString() != "")
            {
                vo.sgs_tvn = decimal.Parse(row["sgs_tvn"].ToString());
            }

            if (row["specification"] != null)
            {
                vo.specification = row["specification"].ToString();
            }
            if (row["storagetype"] != null)
            {
                vo.storagetype = row["storagetype"].ToString();
            }
            if (row["techtype"] != null)
            {
                vo.techtype = row["techtype"].ToString();
            }

            if (row["state3"] != null)//////////////////////////////////////
            {
                vo.State3 = row["state3"].ToString();
                //查询出状态值对应的状态名称
                FishEntity.SystemDataType item = FishEntity.Variable.StateList.Find((i) => { return(i.Code.Equals(vo.State3)); });
                if (item != null)
                {
                    vo.statename = item.Name;
                }
            }

            if (row["weight"] != null)
            {
                vo.weight = decimal.Parse(row["weight"].ToString());
            }
            if (row["package"] != null)
            {
                vo.package = int.Parse(row["package"].ToString());
            }

            return(vo);
        }
Пример #9
0
        private FishEntity.FinishVo DataRowToVo(DataRow row)
        {
            FishEntity.FinishVo model = new FishEntity.FinishVo();

            if (row != null)
            {
                #region product
                if (row["id"] != null && row["id"].ToString() != "")
                {
                    model.id = int.Parse(row["id"].ToString());
                }
                if (row["code"] != null)
                {
                    model.code = row["code"].ToString();
                }
                if (row["name"] != null)
                {
                    model.name = row["name"].ToString();
                }
                if (row["brand"] != null)
                {
                    model.brand = row["brand"].ToString();
                }
                if (row["state"] != null)
                {
                    model.state = row["state"].ToString();
                    //查询出状态值对应的状态名称
                    FishEntity.SystemDataType item = FishEntity.Variable.StateList.Find((i) => { return(i.Code.Equals(model.state)); });
                    if (item != null)
                    {
                        model.statename = item.Name;
                    }
                }
                if (row["nature"] != null)
                {
                    model.nature = row["nature"].ToString();
                }
                if (row["origin"] != null)
                {
                    model.origin = row["origin"].ToString();
                }
                if (row["type"] != null)
                {
                    model.type = row["type"].ToString();
                }
                if (row["getinfotime"] != null && row["getinfotime"].ToString() != "")
                {
                    model.getinfotime = DateTime.Parse(row["getinfotime"].ToString());
                }
                if (row["endinfotime"] != null && row["endinfotime"].ToString() != "")
                {
                    model.endinfotime = DateTime.Parse(row["endinfotime"].ToString());
                }
                if (row["techtype"] != null)
                {
                    model.techtype = row["techtype"].ToString();
                }
                if (row["specification"] != null)
                {
                    model.specification = row["specification"].ToString();
                }
                if (row["productdate"] != null)
                {
                    model.productdate = row["productdate"].ToString();
                }
                if (row["shelflife"] != null && row["shelflife"].ToString() != "")
                {
                    model.shelflife = int.Parse(row["shelflife"].ToString());
                }
                if (row["quality"] != null)
                {
                    model.quality = row["quality"].ToString();
                }
                if (row["manufacturers"] != null)
                {
                    model.manufacturers = row["manufacturers"].ToString();
                }
                if (row["factoryaddress"] != null)
                {
                    model.factoryaddress = row["factoryaddress"].ToString();
                }
                if (row["remark"] != null)
                {
                    model.remark = row["remark"].ToString();
                }
                if (row["weight"] != null && row["weight"].ToString() != "")
                {
                    model.weight = decimal.Parse(row["weight"].ToString());
                }
                if (row["quantity"] != null && row["quantity"].ToString() != "")
                {
                    model.quantity = int.Parse(row["quantity"].ToString());
                }
                if (row["remainweight"] != null && row["remainweight"].ToString() != "")
                {
                    model.remainweight = decimal.Parse(row["remainweight"].ToString());
                }
                if (row["remainquantity"] != null && row["remainquantity"].ToString() != "")
                {
                    model.remainquantity = int.Parse(row["remainquantity"].ToString());
                }
                if (row["homemadeweight"] != null && row["homemadeweight"].ToString() != "")
                {
                    model.homemadeweight = decimal.Parse(row["homemadeweight"].ToString());
                }
                if (row["homemadepackages"] != null && row["homemadepackages"].ToString() != "")
                {
                    model.homemadepackages = int.Parse(row["homemadepackages"].ToString());
                }
                if (row["homemadecost"] != null && row["homemadecost"].ToString() != "")
                {
                    model.homemadecost = decimal.Parse(row["homemadecost"].ToString());
                }
                if (row["homemadeunitprice"] != null && row["homemadeunitprice"].ToString() != "")
                {
                    model.homemadeunitprice = decimal.Parse(row["homemadeunitprice"].ToString());
                }
                if (row["price"] != null && row["price"].ToString() != "")
                {
                    model.price = decimal.Parse(row["price"].ToString());
                }
                if (row["arriveportdate"] != null && row["arriveportdate"].ToString() != "")
                {
                    model.arriveportdate = row["arriveportdate"].ToString();
                }
                if (row["sailingschedule"] != null)
                {
                    model.sailingschedule = row["sailingschedule"].ToString();
                }
                if (row["ownerCode"] != null)
                {
                    model.ownerCode = row["ownerCode"].ToString();
                }
                if (row["ownershortname"] != null)
                {
                    model.ownershortname = row["ownershortname"].ToString();
                }
                if (row["ownername"] != null)
                {
                    model.ownername = row["ownername"].ToString();
                }
                if (row["billofgoods"] != null)
                {
                    model.billofgoods = row["billofgoods"].ToString();
                }
                if (row["agentifcompany"] != null)
                {
                    model.agentifcompany = row["agentifcompany"].ToString();
                }
                if (row["customsofcompany"] != null)
                {
                    model.customsofcompany = row["customsofcompany"].ToString();
                }
                if (row["createtime"] != null && row["createtime"].ToString() != "")
                {
                    model.createtime = DateTime.Parse(row["createtime"].ToString());
                }
                if (row["createman"] != null)
                {
                    model.createman = row["createman"].ToString();
                }
                if (row["modifytime"] != null && row["modifytime"].ToString() != "")
                {
                    model.modifytime = DateTime.Parse(row["modifytime"].ToString());
                }
                if (row["modifyman"] != null)
                {
                    model.modifyman = row["modifyman"].ToString();
                }
                if (row["isdelete"] != null && row["isdelete"].ToString() != "")
                {
                    model.isdelete = int.Parse(row["isdelete"].ToString());
                }
                if (row["suppliercode"] != null)
                {
                    model.suppliercode = row["suppliercode"].ToString();
                }
                if (row["supplier"] != null)
                {
                    model.supplier = row["supplier"].ToString();
                }
                if (row["quote_protein"] != null && row["quote_protein"].ToString() != "")
                {
                    model.quote_protein = decimal.Parse(row["quote_protein"].ToString());
                }
                if (row["quote_tvn"] != null && row["quote_tvn"].ToString() != "")
                {
                    model.quote_tvn = decimal.Parse(row["quote_tvn"].ToString());
                }
                if (row["quote_graypart"] != null && row["quote_graypart"].ToString() != "")
                {
                    model.quote_graypart = decimal.Parse(row["quote_graypart"].ToString());
                }
                if (row["quote_sandsalt"] != null && row["quote_sandsalt"].ToString() != "")
                {
                    model.quote_sandsalt = decimal.Parse(row["quote_sandsalt"].ToString());
                }
                if (row["quote_amine"] != null && row["quote_amine"].ToString() != "")
                {
                    model.quote_amine = decimal.Parse(row["quote_amine"].ToString());
                }
                if (row["quote_ffa"] != null && row["quote_ffa"].ToString() != "")
                {
                    model.quote_ffa = decimal.Parse(row["quote_ffa"].ToString());
                }
                if (row["quote_fat"] != null && row["quote_fat"].ToString() != "")
                {
                    model.quote_fat = decimal.Parse(row["quote_fat"].ToString());
                }
                if (row["quote_water"] != null && row["quote_water"].ToString() != "")
                {
                    model.quote_water = decimal.Parse(row["quote_water"].ToString());
                }
                if (row["quote_sand"] != null && row["quote_sand"].ToString() != "")
                {
                    model.quote_sand = decimal.Parse(row["quote_sand"].ToString());
                }
                if (row["sgs_protein"] != null && row["sgs_protein"].ToString() != "")
                {
                    model.sgs_protein = decimal.Parse(row["sgs_protein"].ToString());
                }
                if (row["sgs_tvn"] != null && row["sgs_tvn"].ToString() != "")
                {
                    model.sgs_tvn = decimal.Parse(row["sgs_tvn"].ToString());
                }
                if (row["sgs_graypart"] != null && row["sgs_graypart"].ToString() != "")
                {
                    model.sgs_graypart = decimal.Parse(row["sgs_graypart"].ToString());
                }
                if (row["sgs_sandsalt"] != null && row["sgs_sandsalt"].ToString() != "")
                {
                    model.sgs_sandsalt = decimal.Parse(row["sgs_sandsalt"].ToString());
                }
                if (row["sgs_amine"] != null && row["sgs_amine"].ToString() != "")
                {
                    model.sgs_amine = decimal.Parse(row["sgs_amine"].ToString());
                }
                if (row["sgs_ffa"] != null && row["sgs_ffa"].ToString() != "")
                {
                    model.sgs_ffa = decimal.Parse(row["sgs_ffa"].ToString());
                }
                if (row["sgs_fat"] != null && row["sgs_fat"].ToString() != "")
                {
                    model.sgs_fat = decimal.Parse(row["sgs_fat"].ToString());
                }
                if (row["sgs_water"] != null && row["sgs_water"].ToString() != "")
                {
                    model.sgs_water = decimal.Parse(row["sgs_water"].ToString());
                }
                if (row["sgs_sand"] != null && row["sgs_sand"].ToString() != "")
                {
                    model.sgs_sand = decimal.Parse(row["sgs_sand"].ToString());
                }
                if (row["label_protein"] != null && row["label_protein"].ToString() != "")
                {
                    model.label_protein = decimal.Parse(row["label_protein"].ToString());
                }
                if (row["label_tvn"] != null && row["label_tvn"].ToString() != "")
                {
                    model.label_tvn = decimal.Parse(row["label_tvn"].ToString());
                }
                if (row["label_graypart"] != null && row["label_graypart"].ToString() != "")
                {
                    model.label_graypart = decimal.Parse(row["label_graypart"].ToString());
                }
                if (row["label_sandsalt"] != null && row["label_sandsalt"].ToString() != "")
                {
                    model.label_sandsalt = decimal.Parse(row["label_sandsalt"].ToString());
                }
                if (row["label_amine"] != null && row["label_amine"].ToString() != "")
                {
                    model.label_amine = decimal.Parse(row["label_amine"].ToString());
                }
                if (row["label_ffa"] != null && row["label_ffa"].ToString() != "")
                {
                    model.label_ffa = decimal.Parse(row["label_ffa"].ToString());
                }
                if (row["label_fat"] != null && row["label_fat"].ToString() != "")
                {
                    model.label_fat = decimal.Parse(row["label_fat"].ToString());
                }
                if (row["labe_water"] != null && row["labe_water"].ToString() != "")
                {
                    model.labe_water = decimal.Parse(row["labe_water"].ToString());
                }
                if (row["label_sand"] != null && row["label_sand"].ToString() != "")
                {
                    model.label_sand = decimal.Parse(row["label_sand"].ToString());
                }
                if (row["label_lysine"] != null && row["label_lysine"].ToString() != "")
                {
                    model.label_lysine = decimal.Parse(row["label_lysine"].ToString());
                }
                if (row["label_methionine"] != null && row["label_methionine"].ToString() != "")
                {
                    model.label_methionine = decimal.Parse(row["label_methionine"].ToString());
                }
                if (row["domestic_protein"] != null && row["domestic_protein"].ToString() != "")
                {
                    model.domestic_protein = decimal.Parse(row["domestic_protein"].ToString());
                }
                if (row["domestic_tvn"] != null && row["domestic_tvn"].ToString() != "")
                {
                    model.domestic_tvn = decimal.Parse(row["domestic_tvn"].ToString());
                }
                if (row["domestic_graypart"] != null && row["domestic_graypart"].ToString() != "")
                {
                    model.domestic_graypart = decimal.Parse(row["domestic_graypart"].ToString());
                }
                if (row["domestic_sandsalt"] != null && row["domestic_sandsalt"].ToString() != "")
                {
                    model.domestic_sandsalt = decimal.Parse(row["domestic_sandsalt"].ToString());
                }
                if (row["domestic_sour"] != null && row["domestic_sour"].ToString() != "")
                {
                    model.domestic_sour = decimal.Parse(row["domestic_sour"].ToString());
                }
                if (row["domestic_lysine"] != null && row["domestic_lysine"].ToString() != "")
                {
                    model.domestic_lysine = decimal.Parse(row["domestic_lysine"].ToString());
                }
                if (row["domestic_methionine"] != null && row["domestic_methionine"].ToString() != "")
                {
                    model.domestic_methionine = decimal.Parse(row["domestic_methionine"].ToString());
                }

                if (row["supplierid"] != null && row["supplierid"].ToString() != "")
                {
                    model.supplierid = int.Parse(row["supplierid"].ToString());
                }
                if (row["linkmanid"] != null && row["linkmanid"].ToString() != "")
                {
                    model.linkmanid = int.Parse(row["linkmanid"].ToString());
                }
                if (row["linkmancode"] != null)
                {
                    model.linkmancode = row["linkmancode"].ToString();
                }
                if (row["linkman"] != null)
                {
                    model.linkman = row["linkman"].ToString();
                }
                if (row["latestquote"] != null && row["latestquote"].ToString() != "")
                {
                    model.latestquote = decimal.Parse(row["latestquote"].ToString());
                }

                if (row["goodsinfo"] != null)
                {
                    model.goodsinfo = row["goodsinfo"].ToString();
                }
                if (row["shipno"] != null)
                {
                    model.shipno = row["shipno"].ToString();
                }
                if (row["cornerno"] != null)
                {
                    model.cornerno = row["cornerno"].ToString();
                }
                if (row["tariffrate"] != null && row["tariffrate"].ToString() != "")
                {
                    model.tariffrate = decimal.Parse(row["tariffrate"].ToString());
                }
                if (row["samplingtime"] != null)
                {
                    model.samplingtime = row["samplingtime"].ToString();
                }
                if (row["warehouse"] != null)
                {
                    model.warehouse = row["warehouse"].ToString();
                }
                if (row["sgsweight"] != null && row["sgsweight"].ToString() != "")
                {
                    model.sgsweight = decimal.Parse(row["sgsweight"].ToString());
                }
                if (row["sgsquantity"] != null && row["sgsquantity"].ToString() != "")
                {
                    model.sgsquantity = int.Parse(row["sgsquantity"].ToString());
                }
                if (row["domestic_amine"] != null && row["domestic_amine"].ToString() != "")
                {
                    model.domestic_amine = decimal.Parse(row["domestic_amine"].ToString());
                }
                if (row["domestic_aminototal"] != null && row["domestic_aminototal"].ToString() != "")
                {
                    model.domestic_aminototal = decimal.Parse(row["domestic_aminototal"].ToString());
                }
                if (row["domestic_fat"] != null && row["domestic_fat"].ToString() != "")
                {
                    model.domestic_fat = decimal.Parse(row["domestic_fat"].ToString());
                }
                #endregion

                #region out
                if (row["saleman"] != null)
                {
                    model.saleman = row["saleman"].ToString();
                }
                if (row["deliveryman"] != null)
                {
                    model.deliveryman = row["deliveryman"].ToString();
                }
                if (row["indate"] != null)
                {
                    model.indate = DateTime.Parse(row["indate"].ToString());
                }

                if (row["outdate"] != null)
                {
                    model.outdate = DateTime.Parse(row["outdate"].ToString());
                }
                if (row["companyname"] != null)
                {
                    model.companyname = row["companyname"].ToString();
                }

                #endregion
            }
            return(model);
        }
Пример #10
0
        public FishEntity.ProductQuoteVo DataRowToModel(DataRow row)
        {
            FishEntity.ProductQuoteVo model = new FishEntity.ProductQuoteVo();
            if (row != null)
            {
                #region product
                if (row["Display"].ToString() == "1")
                {
                    model.Display = 1;
                }
                if (row["Quote_id"] != null && row["Quote_id"].ToString() != "")
                {
                    model.Quote_id = int.Parse(row["Quote_id"].ToString());
                }
                else if (row["Display"].ToString() != "1")
                {
                    model.Display = 0;
                }
                if (row["id"] != null && row["id"].ToString() != "")
                {
                    model.id = int.Parse(row["id"].ToString());
                }
                if (row["code"] != null)
                {
                    model.code = row["code"].ToString();
                }
                if (row["name"] != null)
                {
                    model.name = row["name"].ToString();
                }
                if (row["brand"] != null)
                {
                    model.brand = row["brand"].ToString();
                }
                if (row["quotEexchangeRate"] != null)
                {
                    model.QuotEexchangeRate = row["quotEexchangeRate"].ToString();
                }
                if (row["PlaceOfDelivery"] != null)
                {
                    model.PlaceOfDelivery = row["PlaceOfDelivery"].ToString();
                }
                if (row["state"] != null)
                {
                    model.state = row["state"].ToString();
                    //查询出状态值对应的状态名称
                    FishEntity.SystemDataType item = FishEntity.Variable.StateList.Find((i) => { return(i.Code.Equals(model.state)); });
                    if (item != null)
                    {
                        model.statename = item.Name;
                    }
                }
                //if (row["state1"] != null)
                //{
                //    model.State1 = row["state1"].ToString();
                //    //查询出状态值对应的状态名称
                //    FishEntity.SystemDataType item = FishEntity.Variable.StateList.Find((i) => { return i.Code.Equals(model.State1); });
                //    if (item != null)
                //    {
                //        model.statename = item.Name;
                //    }
                //}
                //if (row["state2"] != null)
                //{
                //    model.State2 = row["state2"].ToString();
                //    //查询出状态值对应的状态名称
                //    FishEntity.SystemDataType item = FishEntity.Variable.StateList.Find((i) => { return i.Code.Equals(model.State2); });
                //    if (item != null)
                //    {
                //        model.statename = item.Name;
                //    }
                //}
                //if (row["state3"] != null)
                //{
                //    model.State3 = row["state1"].ToString();
                //    //查询出状态值对应的状态名称
                //    FishEntity.SystemDataType item = FishEntity.Variable.StateList.Find((i) => { return i.Code.Equals(model.State3); });
                //    if (item != null)
                //    {
                //        model.statename = item.Name;
                //    }
                //}
                //if (row["state4"] != null)
                //{
                //    model.State4 = row["state4"].ToString();
                //    //查询出状态值对应的状态名称
                //    FishEntity.SystemDataType item = FishEntity.Variable.StateList.Find((i) => { return i.Code.Equals(model.State4); });
                //    if (item != null)
                //    {
                //        model.statename = item.Name;
                //    }
                //}
                //if (row["state5"] != null)
                //{
                //    model.State1 = row["state5"].ToString();
                //    //查询出状态值对应的状态名称
                //    FishEntity.SystemDataType item = FishEntity.Variable.StateList.Find((i) => { return i.Code.Equals(model.State5); });
                //    if (item != null)
                //    {
                //        model.statename = item.Name;
                //    }
                //}
                if (row["nature"] != null)
                {
                    model.nature = row["nature"].ToString();
                }
                if (row["port"] != null)
                {
                    model.port = row["port"].ToString();
                }
                if (row["origin"] != null)
                {
                    model.origin = row["origin"].ToString();
                }
                if (row["type"] != null)
                {
                    model.type = row["type"].ToString();
                }
                if (row["getinfotime"] != null && row["getinfotime"].ToString() != "")
                {
                    model.getinfotime = DateTime.Parse(row["getinfotime"].ToString());
                }
                if (row["endinfotime"] != null && row["endinfotime"].ToString() != "")
                {
                    model.endinfotime = DateTime.Parse(row["endinfotime"].ToString());
                }
                if (row["techtype"] != null)
                {
                    model.techtype = row["techtype"].ToString();
                }
                if (row["specification"] != null)
                {
                    model.specification = row["specification"].ToString();
                }
                if (row["productdate"] != null)
                {
                    model.productdate = row["productdate"].ToString();
                }
                if (row["shelflife"] != null && row["shelflife"].ToString() != "")
                {
                    model.shelflife = int.Parse(row["shelflife"].ToString());
                }
                if (row["quality"] != null)
                {
                    model.quality = row["quality"].ToString();
                }
                if (row["manufacturers"] != null)
                {
                    model.manufacturers = row["manufacturers"].ToString();
                }
                if (row["factoryaddress"] != null)
                {
                    model.factoryaddress = row["factoryaddress"].ToString();
                }
                if (row["remark"] != null)
                {
                    model.remark = row["remark"].ToString();
                }
                if (row["weight"] != null && row["weight"].ToString() != "")
                {
                    model.weight = decimal.Parse(row["weight"].ToString());
                }
                if (row["quantity"] != null && row["quantity"].ToString() != "")
                {
                    model.quantity = int.Parse(row["quantity"].ToString());
                }
                if (row["remainweight"] != null && row["remainweight"].ToString() != "")
                {
                    model.remainweight = decimal.Parse(row["remainweight"].ToString());
                }
                if (row["remainquantity"] != null && row["remainquantity"].ToString() != "")
                {
                    model.remainquantity = int.Parse(row["remainquantity"].ToString());
                }
                if (row["homemadeweight"] != null && row["homemadeweight"].ToString() != "")
                {
                    model.homemadeweight = decimal.Parse(row["homemadeweight"].ToString());
                }
                if (row["homemadepackages"] != null && row["homemadepackages"].ToString() != "")
                {
                    model.homemadepackages = int.Parse(row["homemadepackages"].ToString());
                }
                if (row["homemadecost"] != null && row["homemadecost"].ToString() != "")
                {
                    model.homemadecost = decimal.Parse(row["homemadecost"].ToString());
                }
                if (row["homemadeunitprice"] != null && row["homemadeunitprice"].ToString() != "")
                {
                    model.homemadeunitprice = decimal.Parse(row["homemadeunitprice"].ToString());
                }
                if (row["price"] != null && row["price"].ToString() != "")
                {
                    model.price = decimal.Parse(row["price"].ToString());
                }
                if (row["arriveportdate"] != null && row["arriveportdate"].ToString() != "")
                {
                    model.arriveportdate = row["arriveportdate"].ToString();
                }
                if (row["sailingschedule"] != null)
                {
                    model.sailingschedule = row["sailingschedule"].ToString();
                }
                if (row["ownerCode"] != null)
                {
                    model.ownerCode = row["ownerCode"].ToString();
                }
                if (row["ownershortname"] != null)
                {
                    model.ownershortname = row["ownershortname"].ToString();
                }
                if (row["ownername"] != null)
                {
                    model.ownername = row["ownername"].ToString();
                }
                if (row["billofgoods"] != null)
                {
                    model.billofgoods = row["billofgoods"].ToString();
                }
                if (row["agentifcompany"] != null)
                {
                    model.agentifcompany = row["agentifcompany"].ToString();
                }
                if (row["customsofcompany"] != null)
                {
                    model.customsofcompany = row["customsofcompany"].ToString();
                }
                if (row["createtime"] != null && row["createtime"].ToString() != "")
                {
                    model.createtime = DateTime.Parse(row["createtime"].ToString());
                }
                if (row["createman"] != null)
                {
                    model.createman = row["createman"].ToString();
                }
                if (row["modifytime"] != null && row["modifytime"].ToString() != "")
                {
                    model.modifytime = DateTime.Parse(row["modifytime"].ToString());
                }
                if (row["modifyman"] != null)
                {
                    model.modifyman = row["modifyman"].ToString();
                }
                if (row["isdelete"] != null)
                {
                    model.isdelete = int.Parse(row["isdelete"].ToString());
                }
                if (row["suppliercode"] != null)
                {
                    model.suppliercode = row["suppliercode"].ToString();
                }
                if (row["supplier"] != null)
                {
                    model.supplier = row["supplier"].ToString();
                }
                if (row["quote_protein"] != null && row["quote_protein"].ToString() != "")
                {
                    model.quote_protein = decimal.Parse(row["quote_protein"].ToString());
                }
                if (row["quote_tvn"] != null && row["quote_tvn"].ToString() != "")
                {
                    model.quote_tvn = decimal.Parse(row["quote_tvn"].ToString());
                }
                if (row["quote_graypart"] != null && row["quote_graypart"].ToString() != "")
                {
                    model.quote_graypart = decimal.Parse(row["quote_graypart"].ToString());
                }
                if (row["quote_sandsalt"] != null && row["quote_sandsalt"].ToString() != "")
                {
                    model.quote_sandsalt = decimal.Parse(row["quote_sandsalt"].ToString());
                }
                if (row["quote_amine"] != null && row["quote_amine"].ToString() != "")
                {
                    model.quote_amine = decimal.Parse(row["quote_amine"].ToString());
                }
                if (row["quote_ffa"] != null && row["quote_ffa"].ToString() != "")
                {
                    model.quote_ffa = decimal.Parse(row["quote_ffa"].ToString());
                }
                if (row["quote_fat"] != null && row["quote_fat"].ToString() != "")
                {
                    model.quote_fat = decimal.Parse(row["quote_fat"].ToString());
                }
                if (row["quote_water"] != null && row["quote_water"].ToString() != "")
                {
                    model.quote_water = decimal.Parse(row["quote_water"].ToString());
                }
                if (row["quote_sand"] != null && row["quote_sand"].ToString() != "")
                {
                    model.quote_sand = decimal.Parse(row["quote_sand"].ToString());
                }
                if (row["sgs_protein"] != null && row["sgs_protein"].ToString() != "")
                {
                    model.sgs_protein = decimal.Parse(row["sgs_protein"].ToString());
                }
                if (row["sgs_tvn"] != null && row["sgs_tvn"].ToString() != "")
                {
                    model.sgs_tvn = decimal.Parse(row["sgs_tvn"].ToString());
                }
                if (row["sgs_graypart"] != null && row["sgs_graypart"].ToString() != "")
                {
                    model.sgs_graypart = decimal.Parse(row["sgs_graypart"].ToString());
                }
                if (row["sgs_sandsalt"] != null && row["sgs_sandsalt"].ToString() != "")
                {
                    model.sgs_sandsalt = decimal.Parse(row["sgs_sandsalt"].ToString());
                }
                if (row["sgs_amine"] != null && row["sgs_amine"].ToString() != "")
                {
                    model.sgs_amine = decimal.Parse(row["sgs_amine"].ToString());
                }
                if (row["sgs_ffa"] != null && row["sgs_ffa"].ToString() != "")
                {
                    model.sgs_ffa = decimal.Parse(row["sgs_ffa"].ToString());
                }
                if (row["sgs_fat"] != null && row["sgs_fat"].ToString() != "")
                {
                    model.sgs_fat = decimal.Parse(row["sgs_fat"].ToString());
                }
                if (row["sgs_water"] != null && row["sgs_water"].ToString() != "")
                {
                    model.sgs_water = decimal.Parse(row["sgs_water"].ToString());
                }
                if (row["sgs_sand"] != null && row["sgs_sand"].ToString() != "")
                {
                    model.sgs_sand = decimal.Parse(row["sgs_sand"].ToString());
                }
                if (row["label_protein"] != null && row["label_protein"].ToString() != "")
                {
                    model.label_protein = decimal.Parse(row["label_protein"].ToString());
                }
                if (row["label_tvn"] != null && row["label_tvn"].ToString() != "")
                {
                    model.label_tvn = decimal.Parse(row["label_tvn"].ToString());
                }
                if (row["label_graypart"] != null && row["label_graypart"].ToString() != "")
                {
                    model.label_graypart = decimal.Parse(row["label_graypart"].ToString());
                }
                if (row["label_sandsalt"] != null && row["label_sandsalt"].ToString() != "")
                {
                    model.label_sandsalt = decimal.Parse(row["label_sandsalt"].ToString());
                }
                if (row["label_amine"] != null && row["label_amine"].ToString() != "")
                {
                    model.label_amine = decimal.Parse(row["label_amine"].ToString());
                }
                if (row["label_ffa"] != null && row["label_ffa"].ToString() != "")
                {
                    model.label_ffa = decimal.Parse(row["label_ffa"].ToString());
                }
                if (row["label_fat"] != null && row["label_fat"].ToString() != "")
                {
                    model.label_fat = decimal.Parse(row["label_fat"].ToString());
                }
                if (row["labe_water"] != null && row["labe_water"].ToString() != "")
                {
                    model.labe_water = decimal.Parse(row["labe_water"].ToString());
                }
                if (row["label_sand"] != null && row["label_sand"].ToString() != "")
                {
                    model.label_sand = decimal.Parse(row["label_sand"].ToString());
                }
                if (row["label_lysine"] != null && row["label_lysine"].ToString() != "")
                {
                    model.label_lysine = decimal.Parse(row["label_lysine"].ToString());
                }
                if (row["label_methionine"] != null && row["label_methionine"].ToString() != "")
                {
                    model.label_methionine = decimal.Parse(row["label_methionine"].ToString());
                }
                if (row["domestic_protein"] != null && row["domestic_protein"].ToString() != "")
                {
                    model.domestic_protein = decimal.Parse(row["domestic_protein"].ToString());
                }
                if (row["domestic_tvn"] != null && row["domestic_tvn"].ToString() != "")
                {
                    model.domestic_tvn = decimal.Parse(row["domestic_tvn"].ToString());
                }
                if (row["domestic_graypart"] != null && row["domestic_graypart"].ToString() != "")
                {
                    model.domestic_graypart = decimal.Parse(row["domestic_graypart"].ToString());
                }
                if (row["domestic_sandsalt"] != null && row["domestic_sandsalt"].ToString() != "")
                {
                    model.domestic_sandsalt = decimal.Parse(row["domestic_sandsalt"].ToString());
                }
                if (row["domestic_sour"] != null && row["domestic_sour"].ToString() != "")
                {
                    model.domestic_sour = decimal.Parse(row["domestic_sour"].ToString());
                }
                if (row["domestic_lysine"] != null && row["domestic_lysine"].ToString() != "")
                {
                    model.domestic_lysine = decimal.Parse(row["domestic_lysine"].ToString());
                }
                if (row["domestic_methionine"] != null && row["domestic_methionine"].ToString() != "")
                {
                    model.domestic_methionine = decimal.Parse(row["domestic_methionine"].ToString());
                }

                if (row["supplierid"] != null && row["supplierid"].ToString() != "")
                {
                    model.supplierid = int.Parse(row["supplierid"].ToString());
                }
                if (row["linkmanid"] != null && row["linkmanid"].ToString() != "")
                {
                    model.linkmanid = int.Parse(row["linkmanid"].ToString());
                }
                if (row["linkmancode"] != null)
                {
                    model.linkmancode = row["linkmancode"].ToString();
                }
                if (row["linkman"] != null)
                {
                    model.linkman = row["linkman"].ToString();
                }
                if (row["latestquote"] != null && row["latestquote"].ToString() != "")
                {
                    model.latestquote = decimal.Parse(row["latestquote"].ToString());
                }

                if (row["goodsinfo"] != null)
                {
                    model.goodsinfo = row["goodsinfo"].ToString();
                }
                if (row["shipno"] != null)
                {
                    model.shipno = row["shipno"].ToString();
                }
                if (row["cornerno"] != null)
                {
                    model.cornerno = row["cornerno"].ToString();
                }
                if (row["tariffrate"] != null && row["tariffrate"].ToString() != "")
                {
                    model.tariffrate = decimal.Parse(row["tariffrate"].ToString());
                }
                if (row["samplingtime"] != null)
                {
                    model.samplingtime = row["samplingtime"].ToString();
                }
                if (row["warehouse"] != null)
                {
                    model.warehouse = row["warehouse"].ToString();
                }
                if (row["sgsweight"] != null && row["sgsweight"].ToString() != "")
                {
                    model.sgsweight = decimal.Parse(row["sgsweight"].ToString());
                }
                if (row["sgsquantity"] != null && row["sgsquantity"].ToString() != "")
                {
                    model.sgsquantity = int.Parse(row["sgsquantity"].ToString());
                }
                if (row["domestic_amine"] != null && row["domestic_amine"].ToString() != "")
                {
                    model.domestic_amine = decimal.Parse(row["domestic_amine"].ToString());
                }
                if (row["domestic_aminototal"] != null && row["domestic_aminototal"].ToString() != "")
                {
                    model.domestic_aminototal = decimal.Parse(row["domestic_aminototal"].ToString());
                }
                if (row["domestic_fat"] != null && row["domestic_fat"].ToString() != "")
                {
                    model.domestic_fat = decimal.Parse(row["domestic_fat"].ToString());
                }

                #endregion
                #region ProductEx

                if (row["quotedate"] != null)
                {
                    model.quotedate = row["quotedate"].ToString();
                }
                if (row["quoteweight"] != null && row["quoteweight"].ToString() != "")
                {
                    model.quoteweight = decimal.Parse(row["quoteweight"].ToString());
                }
                if (row["quotequantity"] != null && row["quotequantity"].ToString() != "")
                {
                    model.quotequantity = int.Parse(row["quotequantity"].ToString());
                }
                if (row["quotedollars"] != null && row["quotedollars"].ToString() != "")
                {
                    model.quotedollars = decimal.Parse(row["quotedollars"].ToString());
                }
                if (row["quotermb"] != null && row["quotermb"].ToString() != "")
                {
                    model.quotermb = decimal.Parse(row["quotermb"].ToString());
                }
                if (row["quotesuppliercode"] != null)
                {
                    model.quotesuppliercode = row["quotesuppliercode"].ToString();
                }
                if (row["quotesupplier"] != null)
                {
                    model.quotesupplier = row["quotesupplier"].ToString();
                }
                if (row["quotelinkmancode"] != null)
                {
                    model.quotelinkmancode = row["quotelinkmancode"].ToString();
                }
                if (row["quotelinkman"] != null)
                {
                    model.quotelinkman = row["quotelinkman"].ToString();
                }
                if (row["quoteproductyear"] != null)
                {
                    model.quoteproductyear = row["quoteproductyear"].ToString();
                }
                if (row["quoteproductdate"] != null)
                {
                    model.quoteproductdate = row["quoteproductdate"].ToString();
                }
                if (row["quotelife"] != null)
                {
                    model.quotelife = row["quotelife"].ToString();
                }
                if (row["quotesaildatefast"] != null)
                {
                    model.quotesaildatefast = row["quotesaildatefast"].ToString();
                }
                if (row["quotesaildatelate"] != null)
                {
                    model.quotesaildatelate = row["quotesaildatelate"].ToString();
                }

                #endregion
            }

            return(model);
        }
Пример #11
0
        protected void DataRowToVo(FishEntity.ProductVo model, DataRow row)
        {
            if (row != null)
            {
                #region 旧
                //if (row["quotedate"] != null)
                //{
                //    model.quotedate = row["quotedate"].ToString();
                //}
                //if (row["quoteweight"] != null && row["quoteweight"].ToString() != "")
                //{
                //    model.quoteweight = decimal.Parse(row["quoteweight"].ToString());
                //}
                //if (row["quotequantity"] != null && row["quotequantity"].ToString() != "")
                //{
                //    model.quotequantity = int.Parse(row["quotequantity"].ToString());
                //}
                //if (row["quotedollars"] != null && row["quotedollars"].ToString() != "")
                //{
                //    model.quotedollars = decimal.Parse(row["quotedollars"].ToString());
                //}
                //if (row["quotermb"] != null && row["quotermb"].ToString() != "")
                //{
                //    model.quotermb = decimal.Parse(row["quotermb"].ToString());
                //}
                //if (row["quotesuppliercode"] != null)
                //{
                //    model.quotesuppliercode = row["quotesuppliercode"].ToString();
                //}
                //if (row["quotesupplier"] != null)
                //{
                //    model.quotesupplier = row["quotesupplier"].ToString();
                //}
                //if (row["quotelinkmancode"] != null)
                //{
                //    model.quotelinkmancode = row["quotelinkmancode"].ToString();
                //}
                //if (row["quotelinkman"] != null)
                //{
                //    model.quotelinkman = row["quotelinkman"].ToString();
                //}
                //if (row["quoteproductyear"] != null)
                //{
                //    model.quoteproductyear = row["quoteproductyear"].ToString();
                //}
                //if (row["quoteproductdate"] != null)
                //{
                //    model.quoteproductdate = row["quoteproductdate"].ToString();
                //}
                //if (row["quotelife"] != null)
                //{
                //    model.quotelife = row["quotelife"].ToString();
                //}
                //if (row["quotesaildatefast"] != null)
                //{
                //    model.quotesaildatefast = row["quotesaildatefast"].ToString();
                //}
                //if (row["quotesaildatelate"] != null)
                //{
                //    model.quotesaildatelate = row["quotesaildatelate"].ToString();
                //}
                //if (row["confirmdate"] != null)
                //{
                //    model.confirmdate = row["confirmdate"].ToString();
                //}
                //if (row["confirmsgsweight"] != null && row["confirmsgsweight"].ToString() != "")
                //{
                //    model.confirmsgsweight = decimal.Parse(row["confirmsgsweight"].ToString());
                //}
                //if (row["confirmsgsquantity"] != null && row["confirmsgsquantity"].ToString() != "")
                //{
                //    model.confirmsgsquantity = int.Parse(row["confirmsgsquantity"].ToString());
                //}
                //if (row["confirmdollars"] != null && row["confirmdollars"].ToString() != "")
                //{
                //    model.confirmdollars = decimal.Parse(row["confirmdollars"].ToString());
                //}
                //if (row["confirmrmb"] != null && row["confirmrmb"].ToString() != "")
                //{
                //    model.confirmrmb = decimal.Parse(row["confirmrmb"].ToString());
                //}
                //if (row["confirmagentcode"] != null)
                //{
                //    model.confirmagentcode = row["confirmagentcode"].ToString();
                //}
                //if (row["confirmagent"] != null)
                //{
                //    model.confirmagent = row["confirmagent"].ToString();
                //}
                //if (row["confirmlinkmancode"] != null)
                //{
                //    model.confirmlinkmancode = row["confirmlinkmancode"].ToString();
                //}
                //if (row["confirmlinkman"] != null)
                //{
                //    model.confirmlinkman = row["confirmlinkman"].ToString();
                //}
                //if (row["confirmproductyear"] != null)
                //{
                //    model.confirmproductyear = row["confirmproductyear"].ToString();
                //}
                //if (row["confirmproductdate"] != null)
                //{
                //    model.confirmproductdate = row["confirmproductdate"].ToString();
                //}
                //if (row["confirmlife"] != null)
                //{
                //    model.confirmlife = row["confirmlife"].ToString();
                //}
                //if (row["confirmsaildate"] != null)
                //{
                //    model.confirmsaildate = row["confirmsaildate"].ToString();
                //}
                //if (row["pack"] != null)
                //{
                //    model.Pack = row["pack"].ToString();
                //}
                //if (row["spotdate"] != null)
                //{
                //    model.spotdate = row["spotdate"].ToString();
                //}
                //if (row["spotweight"] != null && row["spotweight"].ToString() != "")
                //{
                //    model.spotweight = decimal.Parse(row["spotweight"].ToString());
                //}
                //if (row["spotquantity"] != null && row["spotquantity"].ToString() != "")
                //{
                //    model.spotquantity = int.Parse(row["spotquantity"].ToString());
                //}
                //if (row["spotdollars"] != null && row["spotdollars"].ToString() != "")
                //{
                //    model.spotdollars = decimal.Parse(row["spotdollars"].ToString());
                //}
                //if (row["spotrmb"] != null && row["spotrmb"].ToString() != "")
                //{
                //    model.spotrmb = decimal.Parse(row["spotrmb"].ToString());
                //}
                //if (row["spotagentcode"] != null)
                //{
                //    model.spotagentcode = row["spotagentcode"].ToString();
                //}
                //if (row["spotagent"] != null)
                //{
                //    model.spotagent = row["spotagent"].ToString();
                //}
                //if (row["spotlinkmancode"] != null)
                //{
                //    model.spotlinkmancode = row["spotlinkmancode"].ToString();
                //}
                //if (row["spotlinkman"] != null)
                //{
                //    model.spotlinkman = row["spotlinkman"].ToString();
                //}
                //if (row["spotproductdate"] != null)
                //{
                //    model.spotproductdate = row["spotproductdate"].ToString();
                //}
                //if (row["spotproductyear"] != null)
                //{
                //    model.spotproductyear = row["spotproductyear"].ToString();
                //}
                //if (row["spotlife"] != null)
                //{
                //    model.spotlife = row["spotlife"].ToString();
                //}
                //if (row["spotstoragedate"] != null)
                //{
                //    model.spotstoragedate = row["spotstoragedate"].ToString();
                //}
                //if (row["saledate"] != null)
                //{
                //    model.saledate = row["saledate"].ToString();
                //}
                //if (row["saleremainweight"] != null && row["saleremainweight"].ToString() != "")
                //{
                //    model.saleremainweight = decimal.Parse(row["saleremainweight"].ToString());
                //}
                //if (row["saleremainquantity"] != null && row["saleremainquantity"].ToString() != "")
                //{
                //    model.saleremainquantity = int.Parse(row["saleremainquantity"].ToString());
                //}
                //if (row["saledollars"] != null && row["saledollars"].ToString() != "")
                //{
                //    model.saledollars = decimal.Parse(row["saledollars"].ToString());
                //}
                //if (row["salermb"] != null && row["salermb"].ToString() != "")
                //{
                //    model.salermb = decimal.Parse(row["salermb"].ToString());
                //}
                //if (row["saletradercode"] != null)
                //{
                //    model.saletradercode = row["saletradercode"].ToString();
                //}
                //if (row["saletrader"] != null)
                //{
                //    model.saletrader = row["saletrader"].ToString();
                //}
                //if (row["salelinkmancode"] != null)
                //{
                //    model.salelinkmancode = row["salelinkmancode"].ToString();
                //}
                //if (row["salelinkman"] != null)
                //{
                //    model.salelinkman = row["salelinkman"].ToString();
                //}
                //if (row["saleoutdate"] != null)
                //{
                //    model.saleoutdate = row["saleoutdate"].ToString();
                //}
                //if (row["selfdate"] != null)
                //{
                //    model.selfdate = row["selfdate"].ToString();
                //}
                //if (row["selfstorageweight"] != null && row["selfstorageweight"].ToString() != "")
                //{
                //    model.selfstorageweight = decimal.Parse(row["selfstorageweight"].ToString());
                //}
                //if (row["selfstoragequantity"] != null && row["selfstoragequantity"].ToString() != "")
                //{
                //    model.selfstoragequantity = int.Parse(row["selfstoragequantity"].ToString());
                //}
                //if (row["selfdollars"] != null && row["selfdollars"].ToString() != "")
                //{
                //    model.selfdollars = decimal.Parse(row["selfdollars"].ToString());
                //}
                //if (row["selfrmb"] != null && row["selfrmb"].ToString() != "")
                //{
                //    model.selfrmb = decimal.Parse(row["selfrmb"].ToString());
                //}
                //if (row["selftradercode"] != null)
                //{
                //    model.selftradercode = row["selftradercode"].ToString();
                //}
                //if (row["selftrader"] != null)
                //{
                //    model.selftrader = row["selftrader"].ToString();
                //}
                //if (row["selflinkmancode"] != null)
                //{
                //    model.selflinkmancode = row["selflinkmancode"].ToString();
                //}
                //if (row["selflinkman"] != null)
                //{
                //    model.selflinkman = row["selflinkman"].ToString();
                //}
                //if (row["selffinishproduct"] != null)
                //{
                //    model.selffinishproduct = row["selffinishproduct"].ToString();
                //}
                //if (row["selfstoragedate"] != null)
                //{
                //    model.selfstoragedate = row["selfstoragedate"].ToString();
                //}
                #endregion
                #region product
                if (row["id"] != null && row["id"].ToString() != "")
                {
                    model.id = int.Parse(row["id"].ToString());
                }
                if (row["code"] != null)
                {
                    model.code = row["code"].ToString();
                }
                if (row["name"] != null)
                {
                    model.name = row["name"].ToString();
                }
                if (row["brand"] != null)
                {
                    model.brand = row["brand"].ToString();
                }
                if (row["state4"] != null)
                {
                    model.State4 = row["state4"].ToString();
                    //查询出状态值对应的状态名称
                    FishEntity.SystemDataType item = FishEntity.Variable.StateList.Find((i) => { return(i.Code.Equals(model.State4)); });
                    if (item != null)
                    {
                        model.statename = item.Name;
                    }
                }
                if (row["nature"] != null)
                {
                    model.nature = row["nature"].ToString();
                }
                if (row["port"] != null)
                {
                    model.port = row["port"].ToString();
                }
                if (row["origin"] != null)
                {
                    model.origin = row["origin"].ToString();
                }
                if (row["type"] != null)
                {
                    model.type = row["type"].ToString();
                }
                if (row["getinfotime"] != null && row["getinfotime"].ToString() != "")
                {
                    model.getinfotime = DateTime.Parse(row["getinfotime"].ToString());
                }
                if (row["endinfotime"] != null && row["endinfotime"].ToString() != "")
                {
                    model.endinfotime = DateTime.Parse(row["endinfotime"].ToString());
                }
                if (row["techtype"] != null)
                {
                    model.techtype = row["techtype"].ToString();
                }
                if (row["specification"] != null)
                {
                    model.specification = row["specification"].ToString();
                }
                if (row["productdate"] != null)
                {
                    model.productdate = row["productdate"].ToString();
                }
                if (row["shelflife"] != null && row["shelflife"].ToString() != "")
                {
                    model.shelflife = int.Parse(row["shelflife"].ToString());
                }
                if (row["quality"] != null)
                {
                    model.quality = row["quality"].ToString();
                }
                if (row["manufacturers"] != null)
                {
                    model.manufacturers = row["manufacturers"].ToString();
                }
                if (row["factoryaddress"] != null)
                {
                    model.factoryaddress = row["factoryaddress"].ToString();
                }
                if (row["remark"] != null)
                {
                    model.remark = row["remark"].ToString();
                }
                if (row["weight"] != null && row["weight"].ToString() != "")
                {
                    model.weight = decimal.Parse(row["weight"].ToString());
                }
                if (row["quantity"] != null && row["quantity"].ToString() != "")
                {
                    model.quantity = int.Parse(row["quantity"].ToString());
                }
                if (row["remainweight"] != null && row["remainweight"].ToString() != "")
                {
                    model.remainweight = decimal.Parse(row["remainweight"].ToString());
                }
                if (row["remainquantity"] != null && row["remainquantity"].ToString() != "")
                {
                    model.remainquantity = int.Parse(row["remainquantity"].ToString());
                }
                if (row["homemadeweight"] != null && row["homemadeweight"].ToString() != "")
                {
                    model.homemadeweight = decimal.Parse(row["homemadeweight"].ToString());
                }
                if (row["homemadepackages"] != null && row["homemadepackages"].ToString() != "")
                {
                    model.homemadepackages = int.Parse(row["homemadepackages"].ToString());
                }
                if (row["homemadecost"] != null && row["homemadecost"].ToString() != "")
                {
                    model.homemadecost = decimal.Parse(row["homemadecost"].ToString());
                }
                if (row["homemadeunitprice"] != null && row["homemadeunitprice"].ToString() != "")
                {
                    model.homemadeunitprice = decimal.Parse(row["homemadeunitprice"].ToString());
                }
                if (row["price"] != null && row["price"].ToString() != "")
                {
                    model.price = decimal.Parse(row["price"].ToString());
                }
                if (row["arriveportdate"] != null && row["arriveportdate"].ToString() != "")
                {
                    model.arriveportdate = row["arriveportdate"].ToString();
                }
                if (row["sailingschedule"] != null)
                {
                    model.sailingschedule = row["sailingschedule"].ToString();
                }
                if (row["ownerCode"] != null)
                {
                    model.ownerCode = row["ownerCode"].ToString();
                }
                if (row["ownershortname"] != null)
                {
                    model.ownershortname = row["ownershortname"].ToString();
                }
                if (row["ownername"] != null)
                {
                    model.ownername = row["ownername"].ToString();
                }
                if (row["billofgoods"] != null)
                {
                    model.billofgoods = row["billofgoods"].ToString();
                }
                if (row["agentifcompany"] != null)
                {
                    model.agentifcompany = row["agentifcompany"].ToString();
                }
                if (row["customsofcompany"] != null)
                {
                    model.customsofcompany = row["customsofcompany"].ToString();
                }
                if (row["createtime"] != null && row["createtime"].ToString() != "")
                {
                    model.createtime = DateTime.Parse(row["createtime"].ToString());
                }
                if (row["createman"] != null)
                {
                    model.createman = row["createman"].ToString();
                }
                if (row["modifytime"] != null && row["modifytime"].ToString() != "")
                {
                    model.modifytime = DateTime.Parse(row["modifytime"].ToString());
                }
                if (row["modifyman"] != null)
                {
                    model.modifyman = row["modifyman"].ToString();
                }
                if (row["isdelete"] != null && row["isdelete"].ToString() != "")
                {
                    model.isdelete = int.Parse(row["isdelete"].ToString());
                }
                if (row["suppliercode"] != null)
                {
                    model.suppliercode = row["suppliercode"].ToString();
                }
                if (row["supplier"] != null)
                {
                    model.supplier = row["supplier"].ToString();
                }
                if (row["quote_protein"] != null && row["quote_protein"].ToString() != "")
                {
                    model.quote_protein = decimal.Parse(row["quote_protein"].ToString());
                }
                if (row["quote_tvn"] != null && row["quote_tvn"].ToString() != "")
                {
                    model.quote_tvn = decimal.Parse(row["quote_tvn"].ToString());
                }
                if (row["quote_graypart"] != null && row["quote_graypart"].ToString() != "")
                {
                    model.quote_graypart = decimal.Parse(row["quote_graypart"].ToString());
                }
                if (row["quote_sandsalt"] != null && row["quote_sandsalt"].ToString() != "")
                {
                    model.quote_sandsalt = decimal.Parse(row["quote_sandsalt"].ToString());
                }
                if (row["quote_amine"] != null && row["quote_amine"].ToString() != "")
                {
                    model.quote_amine = decimal.Parse(row["quote_amine"].ToString());
                }
                if (row["quote_ffa"] != null && row["quote_ffa"].ToString() != "")
                {
                    model.quote_ffa = decimal.Parse(row["quote_ffa"].ToString());
                }
                if (row["quote_fat"] != null && row["quote_fat"].ToString() != "")
                {
                    model.quote_fat = decimal.Parse(row["quote_fat"].ToString());
                }
                if (row["quote_water"] != null && row["quote_water"].ToString() != "")
                {
                    model.quote_water = decimal.Parse(row["quote_water"].ToString());
                }
                if (row["quote_sand"] != null && row["quote_sand"].ToString() != "")
                {
                    model.quote_sand = decimal.Parse(row["quote_sand"].ToString());
                }
                if (row["sgs_protein"] != null && row["sgs_protein"].ToString() != "")
                {
                    model.sgs_protein = decimal.Parse(row["sgs_protein"].ToString());
                }
                if (row["sgs_tvn"] != null && row["sgs_tvn"].ToString() != "")
                {
                    model.sgs_tvn = decimal.Parse(row["sgs_tvn"].ToString());
                }
                if (row["sgs_graypart"] != null && row["sgs_graypart"].ToString() != "")
                {
                    model.sgs_graypart = decimal.Parse(row["sgs_graypart"].ToString());
                }
                if (row["sgs_sandsalt"] != null && row["sgs_sandsalt"].ToString() != "")
                {
                    model.sgs_sandsalt = decimal.Parse(row["sgs_sandsalt"].ToString());
                }
                if (row["sgs_amine"] != null && row["sgs_amine"].ToString() != "")
                {
                    model.sgs_amine = decimal.Parse(row["sgs_amine"].ToString());
                }
                if (row["sgs_ffa"] != null && row["sgs_ffa"].ToString() != "")
                {
                    model.sgs_ffa = decimal.Parse(row["sgs_ffa"].ToString());
                }
                if (row["sgs_fat"] != null && row["sgs_fat"].ToString() != "")
                {
                    model.sgs_fat = decimal.Parse(row["sgs_fat"].ToString());
                }
                if (row["sgs_water"] != null && row["sgs_water"].ToString() != "")
                {
                    model.sgs_water = decimal.Parse(row["sgs_water"].ToString());
                }
                if (row["sgs_sand"] != null && row["sgs_sand"].ToString() != "")
                {
                    model.sgs_sand = decimal.Parse(row["sgs_sand"].ToString());
                }
                if (row["label_protein"] != null && row["label_protein"].ToString() != "")
                {
                    model.label_protein = decimal.Parse(row["label_protein"].ToString());
                }
                if (row["label_tvn"] != null && row["label_tvn"].ToString() != "")
                {
                    model.label_tvn = decimal.Parse(row["label_tvn"].ToString());
                }
                if (row["label_graypart"] != null && row["label_graypart"].ToString() != "")
                {
                    model.label_graypart = decimal.Parse(row["label_graypart"].ToString());
                }
                if (row["label_sandsalt"] != null && row["label_sandsalt"].ToString() != "")
                {
                    model.label_sandsalt = decimal.Parse(row["label_sandsalt"].ToString());
                }
                if (row["label_amine"] != null && row["label_amine"].ToString() != "")
                {
                    model.label_amine = decimal.Parse(row["label_amine"].ToString());
                }
                if (row["label_ffa"] != null && row["label_ffa"].ToString() != "")
                {
                    model.label_ffa = decimal.Parse(row["label_ffa"].ToString());
                }
                if (row["label_fat"] != null && row["label_fat"].ToString() != "")
                {
                    model.label_fat = decimal.Parse(row["label_fat"].ToString());
                }
                if (row["labe_water"] != null && row["labe_water"].ToString() != "")
                {
                    model.labe_water = decimal.Parse(row["labe_water"].ToString());
                }
                if (row["label_sand"] != null && row["label_sand"].ToString() != "")
                {
                    model.label_sand = decimal.Parse(row["label_sand"].ToString());
                }
                if (row["label_lysine"] != null && row["label_lysine"].ToString() != "")
                {
                    model.label_lysine = decimal.Parse(row["label_lysine"].ToString());
                }
                if (row["label_methionine"] != null && row["label_methionine"].ToString() != "")
                {
                    model.label_methionine = decimal.Parse(row["label_methionine"].ToString());
                }
                if (row["domestic_protein"] != null && row["domestic_protein"].ToString() != "")
                {
                    model.domestic_protein = decimal.Parse(row["domestic_protein"].ToString());
                }
                if (row["domestic_tvn"] != null && row["domestic_tvn"].ToString() != "")
                {
                    model.domestic_tvn = decimal.Parse(row["domestic_tvn"].ToString());
                }
                if (row["domestic_graypart"] != null && row["domestic_graypart"].ToString() != "")
                {
                    model.domestic_graypart = decimal.Parse(row["domestic_graypart"].ToString());
                }
                if (row["domestic_sandsalt"] != null && row["domestic_sandsalt"].ToString() != "")
                {
                    model.domestic_sandsalt = decimal.Parse(row["domestic_sandsalt"].ToString());
                }
                if (row["domestic_sour"] != null && row["domestic_sour"].ToString() != "")
                {
                    model.domestic_sour = decimal.Parse(row["domestic_sour"].ToString());
                }
                if (row["domestic_lysine"] != null && row["domestic_lysine"].ToString() != "")
                {
                    model.domestic_lysine = decimal.Parse(row["domestic_lysine"].ToString());
                }
                if (row["domestic_methionine"] != null && row["domestic_methionine"].ToString() != "")
                {
                    model.domestic_methionine = decimal.Parse(row["domestic_methionine"].ToString());
                }

                if (row["supplierid"] != null && row["supplierid"].ToString() != "")
                {
                    model.supplierid = int.Parse(row["supplierid"].ToString());
                }
                if (row["linkmanid"] != null && row["linkmanid"].ToString() != "")
                {
                    model.linkmanid = int.Parse(row["linkmanid"].ToString());
                }
                if (row["linkmancode"] != null)
                {
                    model.linkmancode = row["linkmancode"].ToString();
                }
                if (row["linkman"] != null)
                {
                    model.linkman = row["linkman"].ToString();
                }
                if (row["latestquote"] != null && row["latestquote"].ToString() != "")
                {
                    model.latestquote = decimal.Parse(row["latestquote"].ToString());
                }

                if (row["goodsinfo"] != null)
                {
                    model.goodsinfo = row["goodsinfo"].ToString();
                }
                if (row["shipno"] != null)
                {
                    model.shipno = row["shipno"].ToString();
                }
                if (row["cornerno"] != null)
                {
                    model.cornerno = row["cornerno"].ToString();
                }
                if (row["tariffrate"] != null && row["tariffrate"].ToString() != "")
                {
                    model.tariffrate = decimal.Parse(row["tariffrate"].ToString());
                }
                if (row["samplingtime"] != null)
                {
                    model.samplingtime = row["samplingtime"].ToString();
                }
                if (row["warehouse"] != null)
                {
                    model.warehouse = row["warehouse"].ToString();
                }
                if (row["sgsweight"] != null && row["sgsweight"].ToString() != "")
                {
                    model.sgsweight = decimal.Parse(row["sgsweight"].ToString());
                }
                if (row["sgsquantity"] != null && row["sgsquantity"].ToString() != "")
                {
                    model.sgsquantity = int.Parse(row["sgsquantity"].ToString());
                }
                if (row["domestic_amine"] != null && row["domestic_amine"].ToString() != "")
                {
                    model.domestic_amine = decimal.Parse(row["domestic_amine"].ToString());
                }
                if (row["domestic_aminototal"] != null && row["domestic_aminototal"].ToString() != "")
                {
                    model.domestic_aminototal = decimal.Parse(row["domestic_aminototal"].ToString());
                }
                if (row["domestic_fat"] != null && row["domestic_fat"].ToString() != "")
                {
                    model.domestic_fat = decimal.Parse(row["domestic_fat"].ToString());
                }

                #endregion


                #region 自制

                if (row["salermb"] != null && row["salermb"].ToString() != "")
                {
                    model.salermb = decimal.Parse(row["salermb"].ToString());
                }
                if (row["selfstorageweight"] != null && row["selfstorageweight"].ToString() != "")
                {
                    model.selfstorageweight = decimal.Parse(row["selfstorageweight"].ToString());
                }
                if (row["selfstoragequantity"] != null && row["selfstoragequantity"].ToString() != "")
                {
                    model.selfstoragequantity = int.Parse(row["selfstoragequantity"].ToString());
                }

                if (row["selfrmb"] != null && row["selfrmb"].ToString() != "")
                {
                    model.selfrmb = decimal.Parse(row["selfrmb"].ToString());
                }


                if (row["selfstoragedate"] != null)
                {
                    model.selfstoragedate = row["selfstoragedate"].ToString();
                }

                #endregion
            }
        }