コード例 #1
0
ファイル: List.aspx.cs プロジェクト: shekar348/1PointOne
        /// <summary>
        /// Creating List Name save click event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void lBtnSave_Click(object sender, EventArgs e)
        {
            try
            {
                //This logic is developed by ganesh on 29dec09
                lbMsg.Text = string.Empty;
                ListMaster listMaster = new ListMaster(ConnectionString);
                listMaster.ListName = txtListName.Text;
                listMaster.ListDesc = txtListDescription.Text;
                listMaster.ListCowner = txtListCreationowner.Text;
                if (chkSuppress.Checked)
                    listMaster.Active = false;
                else
                    listMaster.Active = true;
                if (chkSeedList.Checked)
                    listMaster.IsSeedList = true;
                ListMasters list = ListMaster.SelectByField("ListName", txtListName.Text.Trim(), ConnectionString);
                if (list.Count > 0)
                {
                    if (list[0].IsDeleted != true)
                        throw new Exception(string.Format("List: {0},  already exists. Please enter other name.", txtListName.Text));
                    else
                    {
                        lbMsg.ForeColor = Color.Red;
                        throw new Exception(string.Format("List: {0}, was deleted previosly & currently exists as inactive mode for reporting stats. Please provide other name.", txtListName.Text));
                    }

                }
                listMaster.CreatedDate = System.DateTime.Now;
                lblMainMsg.Text = string.Format(listMaster.Insert() == true ? "List {0} Created Successfully." : "List {0} Created Failed.", txtListName.Text);
                bindGrid("", "ASC", "ListName");
            }
            catch (Exception ex)
            {
                CreateListPopupExtender.Show();
                lbMsg.Text = "Error: " + ex.Message;
            }
        }
コード例 #2
0
 protected void lBtnSave_Click(object sender, EventArgs e)
 {
     try
     {
         bool status = false;
         lbMsg.Text = string.Empty;
         ListMaster listMaster = new ListMaster(ConnectionString);
         listMaster.ListName = txtListName.Text;
         listMaster.ListDesc = txtListDescription.Text;
         listMaster.ListCowner = txtListCreationowner.Text;
         if (chkSuppress.Checked)
             listMaster.Active = false; //Active Column taking as a 'Suppress'
         else
             listMaster.Active = true;  //Active Column taking as a 'Suppress'
         if (chkSeedList.Checked)
             listMaster.IsSeedList = true;
         ListMasters list = ListMaster.SelectByField("ListName", txtListName.Text.Trim(), ConnectionString);
         if (list.Count > 0)
         {
             if (list[0].IsDeleted != true)
                 throw new Exception(string.Format("List: {0},  already exists. Please enter other name.", txtListName.Text));
             else
             {
                 lbMsg.ForeColor = System.Drawing.Color.Red;
                 throw new Exception(string.Format("List: {0}, was deleted previosly & currently exists as inactive mode for reporting stats. Please provide other name.", txtListName.Text));
             }
         }
         listMaster.CreatedDate = System.DateTime.Now;
         status = listMaster.Insert();
         string lbl = "";
         lbl = txtListName.Text;
         if (txtListName.Text.Contains("&quot;")) { lbl = Server.HtmlEncode(txtListName.Text); }
         if (status == true)
         {
             lblmsgnewlist.Text = string.Format("List: {0} Created Successfully.", lbl);
         }
         else
         {
             lblmsgnewlist.Text = string.Format("List: {0} Created Failed.", lbl);
         }
         bindLists();
         ModalPopupExtenderShowLists.Show();
         lblmsgnewlistUp.Update();
     }
     catch (Exception ex)
     {
         lbMsg.Text = "Error: " + ex.Message;
         ModalPopupExtenderlist.Show();
         txtListName.Focus();
     }
 }
コード例 #3
0
ファイル: RPList.asmx.cs プロジェクト: shekar348/1PointOne
 public XmlDocument AddList(string UserID, string Password, string ListName)
 {
     XmlDocument doc = new System.Xml.XmlDocument();
     StringBuilder str = new StringBuilder();
     str.Append("<ListsInsertInfo>");
     string ConnectionString = GetConnectionString(UserID, Password);
     ListMasters list = ListMaster.SelectByField("ListName", ListName, ConnectionString);
     if (list.Count > 0)
     {
         str.Append("<Message> Already exists. Please enter other ListName</Message>");
     }
     else
     {
         ListMaster listMaster = new ListMaster(ConnectionString);
         listMaster.ListName = ListName;
         listMaster.CreatedDate = System.DateTime.Now;
         if (listMaster.Insert() == true)
         {
             str.Append("<Message> List Created Successfully.</Message>");
         }
     }
     str.Append("</ListsInsertInfo>");
     doc.LoadXml(str.ToString());
     return doc;
 }