/// <summary> 创建出入库单配件信息
        /// </summary>
        /// <param name="stock_inout_id">出入库单ID</param>
        /// <param name="parts_model">采购开单配件信息</param>
        bool CreateIntoPartsStock(string stock_inout_id, tb_parts_purchase_billing_p parts_model, string billid, string billno)
        {
            tb_parts_stock_inout_p PartsInoutModel = new tb_parts_stock_inout_p();
            Dictionary<string, string> dicParam = new Dictionary<string, string>();//参数

            PartsInoutModel.stock_inout_parts_id = Guid.NewGuid().ToString();
            PartsInoutModel.stock_inout_id = stock_inout_id;
            if (!string.IsNullOrEmpty(parts_model.wh_id))
            {
                PartsInoutModel.wh_id = parts_model.wh_id;
                PartsInoutModel.wh_name = parts_model.wh_name;
            }
            PartsInoutModel.num = parts_model.num;
            PartsInoutModel.parts_code = parts_model.parts_code;
            PartsInoutModel.parts_name = parts_model.parts_name;
            PartsInoutModel.drawing_num = parts_model.drawing_num;
            if (!string.IsNullOrEmpty(parts_model.unit_id))
            {
                PartsInoutModel.unit = parts_model.unit_id;
                PartsInoutModel.unit_name = parts_model.unit_name;
            }
            PartsInoutModel.parts_brand = parts_model.parts_brand;
            PartsInoutModel.counts = parts_model.business_counts;//业务数量
            PartsInoutModel.parts_barcode = parts_model.parts_barcode;//条码
            PartsInoutModel.car_parts_code = parts_model.car_factory_code;//车厂编码
            if(parts_model.make_date>0)
            {
                PartsInoutModel.make_date = parts_model.make_date;//生产日期
            }
            if (parts_model.arrival_date > 0)
            {
                PartsInoutModel.validity_date = parts_model.arrival_date;//到期、有效日期
            }
            PartsInoutModel.is_gift = parts_model.is_gift;
            PartsInoutModel.remark = parts_model.remark;
            PartsInoutModel.create_by = GlobalStaticObj.UserID;
            PartsInoutModel.create_name = GlobalStaticObj.UserName;
            PartsInoutModel.create_time = Common.LocalDateTimeToUtcLong(DateTime.Now);
            PartsInoutModel.reference_billid = billid;
            PartsInoutModel.reference_billno = billno;
            PartsInoutModel.model = parts_model.model;

            foreach (PropertyInfo info in PartsInoutModel.GetType().GetProperties())
            {
                string name = info.Name;
                object value = info.GetValue(PartsInoutModel, null);
                dicParam.Add(name, value == null ? "" : value.ToString());
            }
            return DBHelper.Submit_AddOrEdit("出入库配件表添加信息", "tb_parts_stock_inout_p", "stock_inout_parts_id", "", dicParam);
        }
Exemplo n.º 2
0
        /// <summary> 创建出入库单配件信息
        /// </summary>
        /// <param name="stock_inout_id">出入库单ID</param>
        /// <param name="parts_model">采购开单配件信息</param>
        bool CreateIntoPartsStock(string stock_inout_id, tb_parts_sale_billing_p parts_model)
        {
            tb_parts_stock_inout_p PartsInoutModel = new tb_parts_stock_inout_p();
            Dictionary<string, string> dicParam = new Dictionary<string, string>();//参数

            PartsInoutModel.stock_inout_parts_id = Guid.NewGuid().ToString();
            PartsInoutModel.stock_inout_id = stock_inout_id;
            PartsInoutModel.wh_id = parts_model.wh_id;
            PartsInoutModel.num = parts_model.num;
            PartsInoutModel.parts_num = parts_model.parts_code;
            PartsInoutModel.parts_name = parts_model.parts_name;
            PartsInoutModel.drawing_num = parts_model.drawing_num;
            PartsInoutModel.unit = parts_model.unit_id;
            PartsInoutModel.unit_name = parts_model.unit_name;
            PartsInoutModel.parts_brand = parts_model.parts_brand;
            PartsInoutModel.count = parts_model.library_count;//出库数量
            PartsInoutModel.is_gift = parts_model.is_gift;
            PartsInoutModel.remark = parts_model.remark;
            PartsInoutModel.create_by = GlobalStaticObj.UserID;
            PartsInoutModel.create_name = GlobalStaticObj.UserName;
            PartsInoutModel.create_time = Common.LocalDateTimeToUtcLong(DateTime.Now);

            foreach (PropertyInfo info in PartsInoutModel.GetType().GetProperties())
            {
                string name = info.Name;
                object value = info.GetValue(PartsInoutModel, null);
                dicParam.Add(name, value == null ? "" : value.ToString());
            }
            return DBHelper.Submit_AddOrEdit("出入库配件表添加信息", "tb_parts_stock_inout_p", "stock_inout_parts_id", "", dicParam);
        }