Example #1
0
        /// <summary>
        /// 加载供应商档案信息
        /// </summary>
        private void LoadInfo(string supperId)
        {
            if (!string.IsNullOrEmpty(supperId))
            {
                //1.加载供应商档案主信息
                DataTable dt = DBHelper.GetTable("查看一条供应商档案信息", "tb_supplier", "*", " sup_id='" + supperId + "'", "", "");
                if (dt != null && dt.Rows.Count > 0)
                {
                    tb_supplier model = new tb_supplier();
                    CommonFuncCall.SetModlByDataTable(model, dt);
                    CommonFuncCall.SetShowControlValue(this, model, "View");

                    DataTable dt_bill = CommonFuncCall.GetDataTable();
                    if (!string.IsNullOrEmpty(model.sup_type))
                    {
                        lblsup_type.Text = CommonFuncCall.GetBillNameByBillCode(dt_bill, model.sup_type);
                    }
                    if (!string.IsNullOrEmpty(model.unit_properties))
                    {
                        lblunit_properties.Text = CommonFuncCall.GetBillNameByBillCode(dt_bill, model.unit_properties);
                    }
                    if (!string.IsNullOrEmpty(model.price_type))
                    {
                        lblprice_type.Text = CommonFuncCall.GetBillNameByBillCode(dt_bill, model.price_type);
                    }
                    if (!string.IsNullOrEmpty(model.credit_class))
                    {
                        lblcredit_class.Text = CommonFuncCall.GetBillNameByBillCode(dt_bill, model.credit_class);
                    }
                    if (!string.IsNullOrEmpty(model.county))
                    {
                        lblsup_address.Text = CommonFuncCall.GetAddress(model.county) + " " + lblsup_address.Text;
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(model.city))
                        {
                            lblsup_address.Text = CommonFuncCall.GetAddress(model.city) + " " + lblsup_address.Text;
                        }
                        else
                        {
                            if (!string.IsNullOrEmpty(model.province))
                            {
                                lblsup_address.Text = CommonFuncCall.GetAddress(model.province) + " " + lblsup_address.Text;
                            }
                        }
                    }
                }
            }
        }
Example #2
0
        /// <summary>
        /// 加载仓库档案信息
        /// </summary>
        private void LoadInfo(string wareHouseId)
        {
            if (!string.IsNullOrEmpty(wareHouseId))
            {
                //1.加载仓库档案主信息
                DataTable dt = DBHelper.GetTable("查看一条仓库档案信息", "v_warehouse_companyname_username", "*", " wh_id='" + wareHouseId + "'", "", "");
                if (dt != null && dt.Rows.Count > 0)
                {
                    tb_warehouse tb_warehouse_Model = new tb_warehouse();
                    CommonFuncCall.SetModlByDataTable(tb_warehouse_Model, dt);
                    CommonFuncCall.SetShowControlValue(this, tb_warehouse_Model, "View");
                    lblcom_id.Text = dt.Rows[0]["com_name"].ToString();

                    DataSources.EnumDataSources enumDataSources = (DataSources.EnumDataSources)Convert.ToInt16(tb_warehouse_Model.data_source);
                    lbldata_source.Text = DataSources.GetDescription(enumDataSources, true);

                    if (!string.IsNullOrEmpty(tb_warehouse_Model.county))
                    {
                        lblwh_address.Text = CommonFuncCall.GetAddress(tb_warehouse_Model.county) + " " + lblwh_address.Text;
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(tb_warehouse_Model.city))
                        {
                            lblwh_address.Text = CommonFuncCall.GetAddress(tb_warehouse_Model.city) + " " + lblwh_address.Text;
                        }
                        else
                        {
                            if (!string.IsNullOrEmpty(tb_warehouse_Model.province))
                            {
                                lblwh_address.Text = CommonFuncCall.GetAddress(tb_warehouse_Model.province) + " " + lblwh_address.Text;
                            }
                        }
                    }
                }
            }
        }