コード例 #1
0
 private void SetValue(int rowidx, string code)
 {
     if (_list == null)
     {
         return;
     }
     FishEntity.ProductSelfSaleVo vo = _list.Find((i) => { return(i.code == code); });
     if (vo == null)
     {
         return;
     }
     dataGridView1.Rows[rowidx].Cells["sgs_protein"].Value         = vo.sgs_protein == 0 ? "" : vo.sgs_protein.ToString();
     dataGridView1.Rows[rowidx].Cells["sgs_tvn"].Value             = vo.sgs_tvn == 0 ? "" : vo.sgs_tvn.ToString();
     dataGridView1.Rows[rowidx].Cells["sgs_fat"].Value             = vo.sgs_fat == 0 ? "" : vo.sgs_fat.ToString();
     dataGridView1.Rows[rowidx].Cells["sgs_water"].Value           = vo.sgs_water == 0 ? "" : vo.sgs_water.ToString();
     dataGridView1.Rows[rowidx].Cells["sgs_amine"].Value           = vo.sgs_amine == 0 ? "" : vo.sgs_amine.ToString();
     dataGridView1.Rows[rowidx].Cells["sgs_ffa"].Value             = vo.sgs_ffa == 0 ? "" : vo.sgs_ffa.ToString();
     dataGridView1.Rows[rowidx].Cells["sgs_sandsalt"].Value        = vo.sgs_sandsalt == 0 ? "" : vo.sgs_sandsalt.ToString();
     dataGridView1.Rows[rowidx].Cells["sgs_graypart"].Value        = vo.sgs_graypart == 0 ? "" : vo.sgs_graypart.ToString();
     dataGridView1.Rows[rowidx].Cells["domestic_protein"].Value    = vo.domestic_protein == 0 ? "" : vo.domestic_protein.ToString();
     dataGridView1.Rows[rowidx].Cells["domestic_tvn"].Value        = vo.domestic_tvn == 0 ? "" : vo.domestic_tvn.ToString();
     dataGridView1.Rows[rowidx].Cells["domestic_amine"].Value      = vo.domestic_amine == 0 ? "" : vo.domestic_amine.ToString();
     dataGridView1.Rows[rowidx].Cells["domestic_sandsalt"].Value   = vo.domestic_sandsalt == 0 ? "" : vo.domestic_sandsalt.ToString();
     dataGridView1.Rows[rowidx].Cells["domestic_graypart"].Value   = vo.domestic_graypart == 0 ? "" : vo.domestic_graypart.ToString();
     dataGridView1.Rows[rowidx].Cells["domestic_fat"].Value        = vo.domestic_fat == 0 ? "" : vo.domestic_fat.ToString();
     dataGridView1.Rows[rowidx].Cells["domestic_lysine"].Value     = vo.domestic_lysine == 0 ? "" : vo.domestic_lysine.ToString();
     dataGridView1.Rows[rowidx].Cells["domestic_methionine"].Value = vo.domestic_methionine == 0 ? "" : vo.domestic_methionine.ToString();
     dataGridView1.Rows[rowidx].Cells["domestic_aminototal"].Value = vo.domestic_aminototal == 0 ? "" : vo.domestic_aminototal.ToString();
     dataGridView1.Rows[rowidx].Cells["domestic_sour"].Value       = vo.domestic_sour == 0 ? "" : vo.domestic_sour.ToString();
 }
コード例 #2
0
        private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }
            _fish = new FishEntity.ProductSelfSaleVo();
            if (dataGridView1.CurrentRow == null)
            {
                return;
            }
            if (dataGridView1.Rows[e.RowIndex].Cells["supplier"].Value != null && dataGridView1.Rows[e.RowIndex].Cells["supplier"].Value.ToString() != "" && dataGridView1.Rows[e.RowIndex].Cells["supplieruser"].Value != null && dataGridView1.Rows[e.RowIndex].Cells["supplieruser"].Value.ToString() != "")
            {
                _fish.code         = dataGridView1.Rows[e.RowIndex].Cells["code"].Value.ToString();
                _fish.supplier     = dataGridView1.Rows[e.RowIndex].Cells["supplier"].Value.ToString();
                _fish.Supplieruser = dataGridView1.Rows[e.RowIndex].Cells["supplieruser"].Value.ToString();
                if (dataGridView1.Rows[e.RowIndex].Cells["sgs_protein"].Value.ToString() != "" && dataGridView1.Rows[e.RowIndex].Cells["sgs_protein"].Value != null)
                {
                    _fish.sgs_protein = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells["sgs_protein"].Value.ToString());
                }
                if (dataGridView1.Rows[e.RowIndex].Cells["sgs_tvn"].Value.ToString() != "" && dataGridView1.Rows[e.RowIndex].Cells["sgs_tvn"].Value != null)
                {
                    _fish.sgs_tvn = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells["sgs_tvn"].Value.ToString());
                }
                if (dataGridView1.Rows[e.RowIndex].Cells["sgs_fat"].Value.ToString() != "" && dataGridView1.Rows[e.RowIndex].Cells["sgs_fat"].Value != null)
                {
                    _fish.sgs_fat = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells["sgs_fat"].Value.ToString());
                }
                if (dataGridView1.Rows[e.RowIndex].Cells["sgs_water"].Value.ToString() != "" && dataGridView1.Rows[e.RowIndex].Cells["sgs_water"].Value != null)
                {
                    _fish.sgs_water = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells["sgs_water"].Value.ToString());
                }
                if (dataGridView1.Rows[e.RowIndex].Cells["sgs_amine"].Value.ToString() != "" && dataGridView1.Rows[e.RowIndex].Cells["sgs_amine"].Value != null)
                {
                    _fish.sgs_amine = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells["sgs_amine"].Value.ToString());
                }
                if (dataGridView1.Rows[e.RowIndex].Cells["sgs_ffa"].Value.ToString() != "" && dataGridView1.Rows[e.RowIndex].Cells["sgs_ffa"].Value != null)
                {
                    _fish.sgs_ffa = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells["sgs_ffa"].Value.ToString());
                }
                if (dataGridView1.Rows[e.RowIndex].Cells["sgs_sandsalt"].Value.ToString() != "" && dataGridView1.Rows[e.RowIndex].Cells["sgs_sandsalt"].Value != null)
                {
                    _fish.sgs_sandsalt = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells["sgs_sandsalt"].Value.ToString());
                }
                if (dataGridView1.Rows[e.RowIndex].Cells["sgs_graypart"].Value.ToString() != "" && dataGridView1.Rows[e.RowIndex].Cells["sgs_graypart"].Value != null)
                {
                    _fish.sgs_graypart = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells["sgs_graypart"].Value.ToString());
                }
                if (dataGridView1.Rows[e.RowIndex].Cells["domestic_sour"].Value.ToString() != "" && dataGridView1.Rows[e.RowIndex].Cells["domestic_sour"].Value != null)
                {
                    _fish.domestic_sour = decimal.Parse(dataGridView1.Rows[e.RowIndex].Cells["domestic_sour"].Value.ToString());
                }
                _fish.billofgoods = dataGridView1.Rows[e.RowIndex].Cells["billofgoods"].Value.ToString();
                _fish.confirmrmb  = dataGridView1.Rows[e.RowIndex].Cells["confirmrmb"].Value.ToString();
                _fish.shipno      = dataGridView1.Rows[e.RowIndex].Cells["shipno"].Value.ToString();

                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
        }
コード例 #3
0
        protected void AddGroupRow(List <FishEntity.ProductSelfSaleVo> list)
        {
            if (list == null || list.Count < 1)
            {
                return;
            }
            IDictionary <string, FishEntity.ProductSelfSaleVo> groups = new Dictionary <string, FishEntity.ProductSelfSaleVo>();
            string specification = list[0].specification;

            foreach (FishEntity.ProductSelfSaleVo vo in list)
            {
                if (groups.ContainsKey(vo.specification))
                {
                    FishEntity.ProductSelfSaleVo group = groups[vo.specification];
                    group.weight           += vo.weight;
                    group.confirmsgsweight += vo.confirmsgsweight;
                    group.saleremainweight += vo.saleremainweight;
                }
                else
                {
                    FishEntity.ProductSelfSaleVo newvo = new FishEntity.ProductSelfSaleVo();
                    newvo.weight           = vo.weight;
                    newvo.specification    = vo.specification;
                    newvo.saleremainweight = vo.saleremainweight;
                    newvo.confirmsgsweight = vo.confirmsgsweight;
                    newvo.code             = "分组小计";
                    groups.Add(vo.specification, newvo);
                }
            }

            foreach (KeyValuePair <string, FishEntity.ProductSelfSaleVo> pair in groups)
            {
                int idx = list.FindLastIndex((i) => { return(i.specification.Equals(pair.Key)); });
                if (idx >= 0)
                {
                    list.Insert(idx + 1, pair.Value);
                }
            }
        }
コード例 #4
0
        public FishEntity.ProductSelfSaleVo ziying(DataRow row)
        {
            FishEntity.ProductSelfSaleVo model = new FishEntity.ProductSelfSaleVo();

            if (row != null)
            {
                #region product
                if (row["id"] != null)
                {
                    model.id = int.Parse(row["id"].ToString());
                }
                if (row["code"] != null)
                {
                    model.code = row["code"].ToString();
                }
                if (row["createman"] != null)
                {
                    model.createman = row["createman"].ToString();
                }
                //createman
                if (row["codenum"] != null)
                {
                    model.codeNum = row["codenum"].ToString();
                }
                if (row["codenumcontract"] != null)
                {
                    model.codeNumContract = row["codenumcontract"].ToString();
                }
                if (row["confirmrmb"] != null && row["confirmrmb"].ToString() != "")
                {
                    model.confirmrmb = row["confirmrmb"].ToString();
                }
                if (row["billofgoods"] != null)
                {
                    model.billofgoods = row["billofgoods"].ToString();
                }
                if (row["supplier"] != null)
                {
                    model.supplier = row["supplier"].ToString();
                }
                if (row["Supplieruser"] != null)
                {
                    model.Supplieruser = row["Supplieruser"].ToString();
                }
                if (row["confirmdate"] != null)
                {
                    model.confirmdate = row["confirmdate"].ToString();
                }
                if (row["nature"] != null)
                {
                    model.nature = row["nature"].ToString();
                }
                if (row["brand"] != null)
                {
                    model.brand = row["brand"].ToString();
                }
                if (row["specification"] != null)
                {
                    model.specification = row["specification"].ToString();
                }
                if (row["specification"] != null)
                {
                    model.specification = row["specification"].ToString();
                }
                if (row["confirmsgsweight"] != null && row["confirmsgsweight"].ToString() != "")
                {
                    model.confirmsgsweight = decimal.Parse(row["confirmsgsweight"].ToString());
                }
                if (row["qiuhe1"] != null && row["qiuhe1"].ToString() != "")
                {
                    model.saleremainweight = decimal.Parse(row["qiuhe1"].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_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_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_sandsalt"] != null && row["sgs_sandsalt"].ToString() != "")
                {
                    model.sgs_sandsalt = decimal.Parse(row["sgs_sandsalt"].ToString());
                }
                if (row["sgs_graypart"] != null && row["sgs_graypart"].ToString() != "")
                {
                    model.sgs_graypart = decimal.Parse(row["sgs_graypart"].ToString());
                }
                if (row["domestic_protein"] != null && row["domestic_protein"].ToString() != "")
                {
                    model.domestic_protein = decimal.Parse(row["domestic_protein"].ToString());
                }
                if (row["domestic_amine"] != null && row["domestic_amine"].ToString() != "")
                {
                    model.domestic_amine = decimal.Parse(row["domestic_amine"].ToString());
                }
                if (row["domestic_tvn"] != null && row["domestic_tvn"].ToString() != "")
                {
                    model.domestic_tvn = decimal.Parse(row["domestic_tvn"].ToString());
                }
                if (row["domestic_sandsalt"] != null && row["domestic_sandsalt"].ToString() != "")
                {
                    model.domestic_sandsalt = decimal.Parse(row["domestic_sandsalt"].ToString());
                }
                if (row["domestic_graypart"] != null && row["domestic_graypart"].ToString() != "")
                {
                    model.domestic_graypart = decimal.Parse(row["domestic_graypart"].ToString());
                }
                if (row["domestic_sour"] != null && row["domestic_sour"].ToString() != "")
                {
                    model.domestic_sour = decimal.Parse(row["domestic_sour"].ToString());
                }
                if (row["domestic_fat"] != null && row["domestic_fat"].ToString() != "")
                {
                    model.domestic_fat = decimal.Parse(row["domestic_fat"].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["domestic_aminototal"] != null && row["domestic_aminototal"].ToString() != "")
                {
                    model.domestic_aminototal = decimal.Parse(row["domestic_aminototal"].ToString());
                }
                if (row["remark"] != null)
                {
                    model.remark = row["remark"].ToString();
                }
                if (row["shipno"] != null)
                {
                    model.shipno = row["shipno"].ToString();
                }
                if (row["spotdate"] != null)
                {
                    model.spotdate = row["spotdate"].ToString();
                }
                if (row["warehouse"] != null)
                {
                    model.warehouse = row["warehouse"].ToString();
                }
                if (row["cornerno"] != null)
                {
                    model.cornerno = row["cornerno"].ToString();
                }
                if (row["samplingtime"] != null)
                {
                    model.samplingtime = row["samplingtime"].ToString();
                }
                if (row["spotproductdate"] != null)
                {
                    model.spotproductdate = row["spotproductdate"].ToString();
                }
                if (row["port"] != null)
                {
                    model.port = row["port"].ToString();
                }
                if (row["weight"] != null && row["weight"].ToString() != "")
                {
                    model.weight = decimal.Parse(row["weight"].ToString());
                }

                #endregion
            }

            return(model);
        }
コード例 #5
0
        public FishEntity.ProductSelfSaleVo DataRowToModel(DataRow row)
        {
            FishEntity.ProductSelfSaleVo model = new FishEntity.ProductSelfSaleVo();

            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["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["isdelete3"] != null && row["isdelete3"].ToString() != "")
                {
                    model.Isdelete3 = int.Parse(row["isdelete3"].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 Confirm

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

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

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

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

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

                #endregion

                #region 现货
                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();
                }

                #endregion
            }

            return(model);
        }