public void Set(string relateditem)
 {
     try
     {
         string vlreturn = "<table id=\"RL_listselectedLibraries\" class=\"RL_listselectedLibraries\">";
         List<LibrariesInfo> list = new List<LibrariesInfo>();
         if (!CFunctions.IsNullOrEmpty(relateditem))
         {
             list = new CLibraries(CCommon.LANG).Wcmm_Getlist(relateditem);
             if (list != null && list.Count > 0)
             {
                 for (int i = 0; i < list.Count; i++)
                 {
                     LibrariesInfo info = (LibrariesInfo)list[i];
                     vlreturn += "<tr id=\"rlrowi" + i + "\" class=\"rlrowi\">"
                         + "<td class=\"rlnote\">" + info.Name + "</td>"
                         + "<td class=\"rlsort\">" + info.Cname + "</td>"
                         + "<td class=\"rlcomd\"><a href=\"javascript:RLremove(" + info.Id + "," + i + ");\">x</a></td></tr>";
                 }
             }
         }
         RL_containerLibraries.InnerHtml = vlreturn + "</table>";
         RL_containerLibraries.Attributes.Add("title", list == null ? "0" : list.Count.ToString());
         RL_txtRelatedid.Value = relateditem;
         return;
     }
     catch (Exception ex)
     {
         CCommon.CatchEx(ex);
     }
 }
示例#2
0
        protected void cmdCopyOk_Click(object sender, EventArgs e)
        {
            try
            {
                string iidstr = txtIidstr.Value;
                int dest_cid = int.Parse(ddlCopycid.SelectedValue);

                lstError = new List<Errorobject>();
                if (CFunctions.IsNullOrEmpty(iidstr) || dest_cid == 0)
                {
                    lstError = Form_GetError(lstError, Errortype.Error, Definephrase.Copy_error, "", null);
                    Master.Form_ShowError(lstError);
                    return;
                }

                CLibraries BLL = new CLibraries(CCommon.LANG);
                string[] iidarr = iidstr.Split(',');
                for (int i = 0; i < iidarr.Length; i++)
                {
                    LibrariesInfo info = BLL.Wcmm_Getinfo(int.Parse(iidarr[i]));
                    this.Copy_Info(info, dest_cid, BLL);
                }

                cmdCopyOk.Enabled = false;
                lstError = Form_GetError(lstError, Errortype.Completed, Definephrase.Copy_completed, "", null);
                Master.Form_ShowError(lstError);
            }
            catch (Exception ex)
            {
                CCommon.CatchEx(ex);
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            string cid = context.Request.QueryString["cid"];
            string vlreturn = "";
            if (!CFunctions.IsNullOrEmpty(cid) && cid != "0")
            {
                vlreturn = "{\"librariesinfo\":[";
                List<LibrariesInfo> list = new CLibraries(CCommon.LANG).Wcmm_Getlist(int.Parse(cid));
                if (list != null && list.Count > 0)
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        LibrariesInfo info = (LibrariesInfo)list[i];
                        vlreturn += "{\"librariesname\":\"" + info.Name.Replace("\"", "\\\"") + "\", \"librariesid\":\"" + info.Id + "\"}" + (i == list.Count - 1 ? "" : ",");
                    }
                }
                vlreturn += "]}";
            }

            string iid = context.Request.QueryString["iid"];
            if (!CFunctions.IsNullOrEmpty(iid))
            {
                vlreturn = "{\"librariesinfo\":[";
                List<LibrariesInfo> list = new CLibraries(CCommon.LANG).Wcmm_Getlist(iid);
                if (list != null && list.Count > 0)
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        LibrariesInfo info = (LibrariesInfo)list[i];
                        vlreturn += "{\"librariesname\":\"" + info.Name.Replace("\"", "\\\"") + "\", \"librariesid\":\"" + info.Id + "\", \"librariescategory\":\"" + info.Cname + "\"}" + (i == list.Count - 1 ? "" : ",");
                    }
                }
                vlreturn += "]}";
            }

            context.Response.ContentType = "text/plain";
            context.Response.Write(vlreturn);
        }
示例#4
0
        private bool Save_Lang(LibrariesInfo info)
        {
            try
            {
                if (!CFunctions.IsMultiLanguage() || !chkSaveoption_golang.Checked) return false;

                int lang_num = CConstants.LANG_NUM;
                for (int i = 0; i < lang_num; i++)
                {
                    string lang_val = ConfigurationSettings.AppSettings["LANG_" + i];
                    if (lang_val == CCommon.LANG) continue;

                    LibrariesInfo lang_info = info.copy();
                    lang_info.Id = 0;
                    lang_info.Status = (int)CConstants.State.Status.Waitactive;
                    CLibraries DALLibraries = new CLibraries(lang_val);
                    if (DALLibraries.Save(lang_info))
                    {
                        if (lang_info.lFileattach != null && lang_info.lFileattach.Count > 0)
                            if (new CFileattach(lang_val).Save(lang_info.lFileattach, lang_info.Id))
                                DALLibraries.Updatenum(lang_info.Id.ToString(), Queryparam.Sqlcolumn.Album, lang_info.lFileattach.Count);
                    }
                }
                return true;
            }
            catch
            {
                return false;
            }
        }
示例#5
0
        private void Move_Info(LibrariesInfo source_info, int dest_cid, CLibraries BLL)
        {
            if (source_info == null) return;

            LibrariesInfo info_copy = source_info.copy();
            info_copy.Cid = dest_cid;
            info_copy.Status = CCommon.GetStatus_upt();
            info_copy.Username = CCommon.Get_CurrentUsername();
            info_copy.Timeupdate = DateTime.Now;
            BLL.Save(info_copy);
        }
示例#6
0
        private void Copy_Info(LibrariesInfo source_info, int dest_cid, CLibraries BLL)
        {
            if (source_info == null) return;

            LibrariesInfo info_copy = source_info.copy();
            info_copy.Id = 0;
            info_copy.Cid = dest_cid;
            info_copy.Status = CCommon.GetStatus_upt();
            info_copy.Username = CCommon.Get_CurrentUsername();
            info_copy.Timeupdate = DateTime.Now;
            info_copy.Allowcomment = source_info.Allowcomment > 0 ? 1 : 0;
            info_copy.Orderd = 0;
            BLL.Save(info_copy);
        }
示例#7
0
        protected void cmdUpdateorder_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                if (grdView.Rows.Count == 0) return;

                CLibraries BLL = new CLibraries(CCommon.LANG);
                foreach (GridViewRow row in grdView.Rows)
                {
                    HiddenField txtId = (HiddenField)row.FindControl("txtId");
                    TextBox txtOrderd = (TextBox)row.FindControl("txtOrderd");
                    if (txtId != null && txtOrderd != null)
                    {
                        int id = int.Parse(txtId.Value);
                        int orderd = 0;
                        int.TryParse(txtOrderd.Text, out orderd);
                        BLL.Updatenum(id.ToString(), Queryparam.Sqlcolumn.Orderd, orderd);
                    }
                    lstError = new List<Errorobject>();
                    lstError = Form_GetError(lstError, Errortype.Completed, Definephrase.Saveorderd_completed, "", null);
                    Master.Form_ShowError(lstError);
                }
            }
            catch
            {
                lstError = new List<Errorobject>();
                lstError = Form_GetError(lstError, Errortype.Error, Definephrase.Saveorderd_error, "", null);
                Master.Form_ShowError(lstError);
            }
        }