Example #1
0
        public void TerDelete(Model.Terminal terminal, Model.Source source)
        {
            Hashtable ht = new Hashtable();
            ht.Add("Guid", terminal.Guid);
            terminal.Delete(ht);

            ht.Clear();
            ht.Add("TerGuid", terminal.Guid);
            source.Delete(ht);
        }
Example #2
0
        public void ApplyDelete(Model.Application appli,Model.SCW scw, Model.BulkFreight bulk)
        {
            Hashtable ht = new Hashtable();
            ht.Add("Guid", appli.Guid);
            appli.Delete(ht);

            ht.Clear();
            ht.Add("AppGuid", appli.Guid);
            scw.Delete(ht);
            bulk.Delete(ht);
        }
Example #3
0
        public void Edit(Model.AcceptForm acceptform, Model.AD ad, Model.Client client, Model.Publish publish)
        {
            //客户信息插入或更新
            Hashtable hs = new Hashtable();
            hs.Add("ClientName", client.ClientName);
            if (client.IsExist(hs))
            {
                client.Update(
                    "ClientName='" + client.ClientName + "',Tel='" + client.Tel + "',Mobile='" + client.Mobile + "',Operator='" + client.Operator + "',AgencyCompany='" + client.AgencyCompany + "'",
                    " and ClientName ='" + client.ClientName + "'");
                HD.Model.Client newClient = HD.Model.Client.Instance.GetModelById(hs);
                acceptform.ClientGuid = newClient.ClientPGuid;
            }
            else
            {
                client.ClientPostTime = DateTime.Now;
                client.ClientPGuid = Public.GetGuID;
                client.Insert();
                acceptform.ClientGuid = client.ClientPGuid;
            }

            //广告插入
            ad.Update();

            //先删除原来的发布形式,再循环插入发布形式
            //string strSql = " and ADGuid='" + publish.ADGuid + "'";
            hs.Clear();
            hs.Add("ADGuid", ad.ADPGuid);
            publish.Delete(hs);
            //string StrSql = "Select * From " + DbConfig.Prefix + "Admin Where [email protected] And [email protected] And IsLock=1";
            //IDataParameter[] Param = new IDataParameter[] { 
            //    DbHelper.MakeParam("@AdminName",AdminName),
            //    DbHelper.MakeParam("@AdminPass",AdminPass)
            //};
            string[] pubTypeName = publish.PublishType.Split(',');
            string[] pubTypeNu = publish.PublishQuantity.Split(',');
            for (int i = 0; i < pubTypeName.Length; i++)
            {
                publish.ADGuid = ad.ADPGuid;
                publish.PublishType = pubTypeName[i];
                publish.PublishQuantity = pubTypeNu[i];

                publish.Insert();
            }

            //更新受理单信息
            acceptform.Update(acceptform);

        }
        /// <summary>
        /// Deletes the specified Model.
        /// </summary>
        /// <param name="model">Model to be deleted.</param>
        /// <param name="deleteNoCascade">Flag indicating whether to Delete or todo DeleteNoCascadde.</param>
        private static void DeleteModel(Model model, bool deleteNoCascade)
        {
            if (null == model)
            {
                return;
            }

            string modelName = model.Name;
            if (deleteNoCascade)
            {
                var ownedEntities = model.OwnedEntities;

                //Deactivate all owned entities.
                foreach (var entity in ownedEntities)
                {
                    entity.Deactivate();
                }

                model.DeleteNoCascade();
            }
            else
            {
                model.Delete();
            }
        }