Пример #1
0
        protected void OnCategoryClick(Object sender, EventArgs e)
        {
            LinkButton btn = (LinkButton)sender;
            String     sc  = btn.Text.Trim();

            String[] argarray = btn.CommandArgument.Split('|');
            String   subCatID = argarray[0];
            int      dataform = Convert.ToInt32(argarray[1]);

            switch (dataform)
            {
            case 0:
                Response.Redirect(String.Format("{0}?BuildingID={1}&SCID={2}",
                                                dataForm0, AESUtil.EncryptString(txtBuildingID.Text), AESUtil.EncryptString(subCatID)));
                break;

            case 1:
                Response.Redirect(String.Format("{0}?BuildingID={1}&SCID={2}",
                                                dataForm1, AESUtil.EncryptString(txtBuildingID.Text), AESUtil.EncryptString(subCatID)));
                break;

            default:
                Response.Redirect(String.Format("{0}?BuildingID={1}&SCID={2}",
                                                dataForm1, AESUtil.EncryptString(txtBuildingID.Text), AESUtil.EncryptString(subCatID)));
                break;
            }
        }
Пример #2
0
        protected String GetFormUrl(object euid, object bldgid, object scid)
        {
            String linkURL = String.Format("{0}?EntryUID={1}&BuildingID={2}&SCID={3}",
                                           editpage, AESUtil.EncryptString(euid.ToWSSafeString()),
                                           AESUtil.EncryptString(bldgid.ToWSSafeString()),
                                           AESUtil.EncryptString(scid.ToWSSafeString()));

            return(linkURL);
        }
Пример #3
0
        public static String GenerateSubMenu(String buildingid, String section, String category)
        {
            String    sm         = "";
            String    sql        = String.Format("SELECT Q_SubCategory_List.SectionName, Q_SubCategory_List.Main_Category, Q_SubCategory_List.Sub_Category, IIf([Q_Data1_L2_Count].ct Is Null,0,[Q_Data1_L2_Count].ct) AS ct, IIf([Q_Data1_L2_Count_Failed].ct Is Null,0,[Q_Data1_L2_Count_Failed].ct) AS ctfailed, Q_SubCategory_List.DisplayOrder, QBDG.Building_ID, Q_SubCategory_List.DataForm, Q_SubCategory_List.ID FROM (Q_SubCategory_List LEFT JOIN (SELECT * FROM Q_Data1_L2_Count WHERE BUILDING_ID={0}) AS QBDG ON (Q_SubCategory_List.ID = QBDG.ID)) LEFT JOIN (SELECT * FROM Q_Data1_L2_Count_Failed WHERE BUILDING_ID={0}) AS QBDG2  ON (Q_SubCategory_List.ID = QBDG2.ID) WHERE Q_SubCategory_List.Main_Category='{2}' ORDER BY Q_SubCategory_List.DisplayOrder", buildingid, section.ToWSSafeString(), category.ToWSSafeString());
            DataTable dtItemList = DBUtil.GetOLEDataTable("_SiteAccess", sql, "itemlist");

            sm += "<ul data-role='listview' data-inset='true' data-filter='false' data-theme='f' >";
            foreach (DataRow dr in dtItemList.Rows)
            {
                String menulabel   = GetCategoryLabel(dr[m_field_subCategory].ToWSSafeString());
                Int16  dataform    = Convert.ToInt16(dr["DataForm"]);
                String scid        = dr["ID"].ToWSSafeString();
                String linkurl     = "";
                Int16  dataCount   = Convert.ToInt16(dr["ct"]);
                Int16  failedCount = Convert.ToInt16(dr["ctfailed"]);
                switch (dataform)
                {
                case 0:
                    linkurl = String.Format("{0}?BuildingID={1}&SCID={2}",
                                            dataForm0, AESUtil.EncryptString(buildingid), AESUtil.EncryptString(scid));
                    string Form0Count = DBUtil.DoLookup(DBUtil.DBType.oledb, "_SiteAccess", "Building_ID", buildingid, DBUtil.FieldType.number, "ct", String.Format("SELECT * FROM [Q_Data0_L2_count] WHERE ID={0}", dr["ID"].ToWSSafeString()));
                    if (String.IsNullOrWhiteSpace(Form0Count))
                    {
                        dataCount = 0;
                    }
                    else
                    {
                        dataCount = Convert.ToInt16(Form0Count);
                    }
                    failedCount = 0;
                    break;

                case 1:
                    linkurl = String.Format("{0}?BuildingID={1}&SCID={2}",
                                            dataForm1, AESUtil.EncryptString(buildingid), AESUtil.EncryptString(scid));
                    break;

                default:
                    linkurl = String.Format("{0}?BuildingID={1}&SCID={2}",
                                            dataForm1, AESUtil.EncryptString(buildingid), AESUtil.EncryptString(scid));
                    break;
                }

                sm += "<li>";
                sm += String.Format("<a class='listbutton-no-ellipsis' href='{1}'>{0}</a>", menulabel, linkurl);
                if (failedCount > 0)
                {
                    sm += String.Format("<span class='ul-li-image-bubble-container' ><span class='ul-li-image-bubble-caption'>{0}</span></span>", failedCount);
                }
                sm += String.Format("<span class='ui-li-count'>{0}</span>", dataCount);
                sm += "</li>";
            }
            sm += "</ul>";
            return(sm);
        }
Пример #4
0
        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            String cname = e.CommandName.ToWSSafeString();
            String carg  = e.CommandArgument.ToWSSafeString();

            if (cname.ToUpper() == "ViewEdit".ToUpper())
            {
                Response.Redirect(String.Format("{0}?EntryUID={1}&BuildingID={2}&SCID={3}",
                                                editpage, AESUtil.EncryptString(carg),
                                                AESUtil.EncryptString(txtBuildingID.Text), AESUtil.EncryptString(txtSubCatID.Text)));
            }
        }
Пример #5
0
 protected String GetBackLink()
 {
     return(String.Format("{0}?BuildingID={1}&SCID={2}",
                          dataForm1, AESUtil.EncryptString(txtBuildingID.Text), AESUtil.EncryptString(txtSubCatID.Text)));
 }
Пример #6
0
 protected String GetSelectCatLink()
 {
     return(String.Format("{0}?BuildingID={1}&CFID={2}", selectCategoryPage, AESUtil.EncryptString(txtBuildingID.Text), AESUtil.EncryptString(txtCategoryFirstID.Text)));
 }
Пример #7
0
 protected void btnAddNew_Click(object sender, EventArgs e)
 {
     Response.Redirect(String.Format("{0}?EntryUID={1}&BuildingID={2}&SCID={3}",
                                     editpage, AESUtil.EncryptString(AddNewKey),
                                     AESUtil.EncryptString(txtBuildingID.Text), AESUtil.EncryptString(txtSubCatID.Text)));
 }
Пример #8
0
        protected void btnGo_Click(object sender, EventArgs e)
        {
            String buildingid = ddBuilding.SelectedValue.ToWSSafeString();

            Response.Redirect(String.Format("{0}?BuildingID={1}", selectcategorypage, AESUtil.EncryptString(buildingid)));
        }
Пример #9
0
        protected void OnCategoryClick(Object sender, EventArgs e)
        {
            LinkButton btn = (LinkButton)sender;
            String     sc  = btn.Text.Trim();
            //String section = btn.CommandArgument;
            //Response.Redirect(String.Format("{0}?BuildingID={1}&Section={2}&Category={3}", selectsubcategorypage, AESUtil.EncryptString(txtBuildingID.Text), AESUtil.EncryptString(section), AESUtil.EncryptString(sc)));
            String CategoryFirstID = btn.CommandArgument;

            Response.Redirect(String.Format("{0}?BuildingID={1}&CFID={2}", selectsubcategorypage, AESUtil.EncryptString(txtBuildingID.Text), AESUtil.EncryptString(CategoryFirstID)));
        }