Example #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);
         }
     }
 }
Example #2
0
        public bool DeleteCustomer(DataSet ds, string authKey)
        {
            bool ret = false;

            if (authKey == key)
            {
                if (ds != null && ds.Tables.Count > 0)
                {
                    SOSOshop.BLL.MemberAccount        ma    = new SOSOshop.BLL.MemberAccount();
                    SOSOshop.BLL.DrugsBase_Enterprise debll = new SOSOshop.BLL.DrugsBase_Enterprise();
                    SOSOshop.BLL.MemberInfo           mibll = new SOSOshop.BLL.MemberInfo();
                    DataTable dt = ds.Tables[0];
                    foreach (DataRow dr in dt.Rows)
                    {
                        object uid = mibll.ExecuteScalar("select UID from MemberAccount where MobilePhone='" + dr["联系手机"].ToString() + "'");
                        if (uid != null)
                        {
                            mibll.Delete((int)uid);
                        }
                    }
                    ret = true;
                }
            }
            return(ret);
        }
Example #3
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);
            }
        }