Esempio n. 1
0
 /// <summary>
 /// 修改企业信息
 /// </summary>
 /// <param name="dr"></param>
 private void modifyEenerprise(DataRow dr)
 {
     if (dr != null)
     {
         try
         {
             SOSOshop.Model.DrugsBase_Enterprise de    = new SOSOshop.Model.DrugsBase_Enterprise();
             SOSOshop.BLL.DrugsBase_Enterprise   debll = new SOSOshop.BLL.DrugsBase_Enterprise();
             de = debll.GetModel(dr["公司编号"].ToString());
             if (de == null)
             {
                 addEenerprise(dr);
                 return;
             }
             de.Address = dr["地址"].ToString();
             //de.BuyFilingStatus = (bool)dr["是否建档"] ? 1 : 2;
             de.Name        = dr["公司名称"].ToString();
             de.OfficePhone = dr["座机"].ToString();
             de.PYJM        = SOSOshop.BLL.Common.GetPY.Get(de.Name.Trim());
             de.TrueName    = dr["联系人名"].ToString();
             debll.Update(de);
         }
         catch (Exception ex)
         {
             SOSOshop.BLL.Logs.Log.LogServiceAdd(ex.Message, 0, "", "modifyEenerprise", ex.ToString(), 2);
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        /// 新增企业
        /// </summary>
        /// <param name="dr"></param>
        private void addEenerprise(DataRow dr)
        {
            if (dr != null)
            {
                SOSOshop.Model.DrugsBase_Enterprise de    = new SOSOshop.Model.DrugsBase_Enterprise();
                SOSOshop.BLL.DrugsBase_Enterprise   debll = new SOSOshop.BLL.DrugsBase_Enterprise();
                de = debll.GetModel(dr["公司编号"].ToString());
                if (de != null)
                {
                    modifyEenerprise(dr);
                    return;
                }
                else if (de == null)
                {
                    de = new SOSOshop.Model.DrugsBase_Enterprise();
                }
                de.Address         = dr["地址"].ToString();
                de.BuyFilingStatus = 1;
                de.Code            = dr["公司编号"].ToString();
                de.Name            = dr["公司名称"].ToString();
                de.OfficePhone     = dr["座机"].ToString();
                de.Status          = 0;

                de.PYJM     = SOSOshop.BLL.Common.GetPY.Get(de.Name.Trim());
                de.TrueName = dr["联系人名"].ToString();
                debll.Add(de);
            }
        }