)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Home » Code Library » Default (Ia.Statistics.Wa.Models.Ui)

Public general use code classes and xml files that we've compiled and used over the years:

    1: using System.Configuration;
    2:  
    3: namespace Ia.Statistics.Wa.Models.Ui
    4: {
    5:     ////////////////////////////////////////////////////////////////////////////
    6:  
    7:     /// <summary publish="true">
    8:     ///
    9:     /// </summary>
   10:     /// 
   11:     /// <remarks> 
   12:     /// Copyright © 2006-2025 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   13:     ///
   14:     /// This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
   15:     /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   16:     ///
   17:     /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   18:     /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   19:     /// 
   20:     /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
   21:     /// 
   22:     /// Copyright notice: This notice may not be removed or altered from any source distribution.
   23:     /// </remarks> 
   24:     public abstract class Default
   25:     {
   26:         ////////////////////////////////////////////////////////////////////////////
   27:  
   28:         /// <summary>
   29:         ///
   30:         /// </summary>
   31:         public Default()
   32:         {
   33:         }
   34:  
   35:         ////////////////////////////////////////////////////////////////////////////
   36:  
   37:         /// <summary>
   38:         ///
   39:         /// </summary>
   40:         public static string MailTop()
   41:         {
   42:             return @"
   43: <!DOCTYPE html>
   44: <html xmlns=""http://www.w3.org/1999/xhtml"" >
   45: <head>
   46: <title>" + Ia.Cl.Models.ApplicationConfiguration.GetSetting("AppSettings:SiteName") + ": " + Ia.Cl.Models.ApplicationConfiguration.GetSetting("AppSettings:CompanyName") + @"</title>
   47: <style>
   48: html { direction:ltr; }
   49: body { background:#fff;margin:5px;padding:0px;color:DarkBlue; }
   50: body,td,th,a,input.button_ia,input,textarea,option,select,pre { font:9pt normal #000066 ""Tahoma"";font-family:Tahoma;text-decoration:none; }
   51: a:link { color:#0000ff;text-decoration:none; }
   52: a:visited { color:#0000ff;text-decoration:none; }
   53: a:hover { color:#ff8888;text-decoration:none; }
   54: hr { color:rgb(204,204,204); }
   55: p { line-height:18px;margin-top:9px;margin-bottom:9px; }
   56: table.form { }
   57: table.form td { }
   58: </style>
   59: </head>
   60: <body>
   61:  
   62: <p><b>" + Ia.Cl.Models.ApplicationConfiguration.GetSetting("AppSettings:SiteName") + "</b>: <b>" + Ia.Cl.Models.ApplicationConfiguration.GetSetting("AppSettings:CompanyName") + @"</b></p>
   63: ";
   64:         }
   65:  
   66:         ////////////////////////////////////////////////////////////////////////////
   67:  
   68:         /// <summary>
   69:         ///
   70:         /// </summary>
   71:         public static string PlainMailTop()
   72:         {
   73:             return Ia.Cl.Models.ApplicationConfiguration.GetSetting("AppSettings:SiteName") + ": " + Ia.Cl.Models.ApplicationConfiguration.GetSetting("AppSettings:CompanyName") + @"
   74: ";
   75:         }
   76:  
   77:         ////////////////////////////////////////////////////////////////////////////
   78:  
   79:         /// <summary>
   80:         ///
   81:         /// </summary>
   82:         public static string MailBottom()
   83:         {
   84:             return @"
   85: </body>
   86: </html>
   87: ";
   88:         }
   89:  
   90:         ////////////////////////////////////////////////////////////////////////////
   91:  
   92:         /// <summary>
   93:         ///
   94:         /// </summary>
   95:         public static string PlainMailBottom()
   96:         {
   97:             return @"";
   98:         }
   99:  
  100:         /*
  101:         ////////////////////////////////////////////////////////////////////////////
  102: 
  103:         /// <summary>
  104:         ///
  105:         /// </summary>
  106:         public static void ProfileRepeater_ItemDataBound(System.Web.UI.Page page, object sender, RepeaterItemEventArgs e)
  107:         {
  108:             ListItemType itemType = e.Item.ItemType;
  109: 
  110:             if (itemType == ListItemType.Item || itemType == ListItemType.AlternatingItem)
  111:             {
  112:                 Ia.Statistics.Wa.Model.Data.Portfolio portfolio = (Ia.Statistics.Wa.Model.Data.Portfolio)e.Item.DataItem;
  113: 
  114:                 for (int i = 0; i < e.Item.Controls.Count; i++)
  115:                 {
  116:                     try
  117:                     {
  118:                         if (e.Item.Controls[i].GetType().ToString() == "System.Web.UI.WebControls.Label")
  119:                         {
  120:                             Label l = (Label)e.Item.Controls[i];
  121: 
  122:                             if (l.ID == "titleLabel") l.Text = portfolio.Title;
  123:                             else if (l.ID == "descriptionLabel") l.Text = portfolio.Description;
  124:                             else if (l.ID == "technologyLabel") l.Text = portfolio.Technology;
  125:                         }
  126:                         else if (e.Item.Controls[i].GetType().ToString() == "System.Web.UI.WebControls.HyperLink")
  127:                         {
  128:                             System.Web.UI.WebControls.HyperLink hl = (System.Web.UI.WebControls.HyperLink)e.Item.Controls[i];
  129: 
  130:                             if (hl.ID == "navigateUrlHyperLink")
  131:                             {
  132:                                 hl.NavigateUrl = "/service/winform.aspx";
  133:                                 hl.BorderWidth = 0;
  134:                                 hl.Text = hl.ToolTip = portfolio.Title;
  135:                             }
  136:                         }
  137:                         else if (e.Item.Controls[i].GetType().ToString() == "System.Web.UI.WebControls.Image")
  138:                         {
  139:                             System.Web.UI.WebControls.Image im = (System.Web.UI.WebControls.Image)e.Item.Controls[i];
  140: 
  141:                             if (im.ID == "captureImage")
  142:                             {
  143:                                 im.ImageUrl = portfolio.CaptureImage;
  144:                                 im.BorderWidth = 0;
  145:                                 im.AlternateText = im.ToolTip = portfolio.Title;
  146:                             }
  147:                         }
  148:                     }
  149:                     catch { }
  150:                 }
  151:             }
  152:         }
  153:         */
  154:  
  155:         /*
  156:         ////////////////////////////////////////////////////////////////////////////
  157: 
  158:         /// <summary>
  159:         ///
  160:         /// </summary>
  161:         public static void NamespaceRepeater_ItemDataBound(System.Web.UI.Page page, object sender, RepeaterItemEventArgs e)
  162:         {
  163:             ListItemType itemType = e.Item.ItemType;
  164: 
  165:             if (itemType == ListItemType.Item || itemType == ListItemType.AlternatingItem)
  166:             {
  167:                 Ia.Cl.Model.Data.CodeLibrary codeLibrary = (Ia.Cl.Model.Data.CodeLibrary)e.Item.DataItem;
  168: 
  169:                 for (int i = 0; i < e.Item.Controls.Count; i++)
  170:                 {
  171:                     try
  172:                     {
  173:                         if (e.Item.Controls[i].GetType().ToString() == "System.Web.UI.WebControls.Label")
  174:                         {
  175:                             Label l = (Label)e.Item.Controls[i];
  176: 
  177:                             if (l.ID == "classNameLabel") l.Text = codeLibrary.ClassName;
  178:                             else if (l.ID == "namespaceLabel") l.Text = codeLibrary.Namespace;
  179:                             else if (l.ID == "summaryLabel") l.Text = codeLibrary.Summary;
  180:                         }
  181:                         else if (e.Item.Controls[i].GetType().ToString() == "System.Web.UI.WebControls.HyperLink")
  182:                         {
  183:                             System.Web.UI.WebControls.HyperLink hl = (System.Web.UI.WebControls.HyperLink)e.Item.Controls[i];
  184: 
  185:                             if (hl.ID == "codeFileHyperLink")
  186:                             {
  187:                                 hl.NavigateUrl = "/library/" + codeLibrary.Namespace.ToLower() + "." + codeLibrary.ClassName.ToLower() + ".aspx";
  188:                                 hl.BorderWidth = 0;
  189:                                 hl.Text = hl.ToolTip = codeLibrary.ClassName + " (" + codeLibrary.Namespace + ")";
  190:                             }
  191:                         }
  192:                     }
  193:                     catch { }
  194:                 }
  195:             }
  196:         }
  197:         */
  198:  
  199:         /*
  200:         ////////////////////////////////////////////////////////////////////////////
  201: 
  202:         /// <summary>
  203:         ///
  204:         /// </summary>
  205:         public static void GridView_RowDataBound(System.Web.UI.Page page, object sender, GridViewRowEventArgs e)
  206:         {
  207:             bool senderKnown;
  208:             string s, senderId;
  209: 
  210:             //Ia.Cl.Model.Nfc.Inventory inventory;
  211:             //Ia.Cl.Model.Nfc.Tag tag;
  212: 
  213:             senderId = e.Row.Parent.Parent.ID;
  214: 
  215:             if (e.Row.RowType == DataControlRowType.Header || e.Row.RowType == DataControlRowType.Footer || e.Row.RowType == DataControlRowType.DataRow)
  216:             {
  217:                 //inventory = null;
  218:                 //tag = null;
  219: 
  220:                 senderKnown = true;
  221: 
  222:                 switch (senderId)
  223:                 {
  224:                     case "inventoryGridView":
  225:                         {
  226:                             //inventory = (e.Row.DataItem as Ia.Cl.Model.Nfc.Inventory);
  227:                             break;
  228:                         }
  229:                     case "tagGridView":
  230:                         {
  231:                             //tag = (e.Row.DataItem as Ia.Cl.Model.Nfc.Tag);
  232:                             break;
  233:                         }
  234:                     default:
  235:                         {
  236:                             senderKnown = false;
  237:                             break;
  238:                         }
  239:                 }
  240: 
  241:                 if (senderKnown)
  242:                 {
  243:                     if (e.Row.RowType == DataControlRowType.Header)
  244:                     {
  245:                     }
  246:                     else if (e.Row.RowType == DataControlRowType.DataRow)
  247:                     {
  248:                         foreach (Control control in e.Row.Controls)
  249:                         {
  250:                             try
  251:                             {
  252:                                 if (control.Controls.Count > 0)
  253:                                 {
  254:                                     if (control.Controls[0].GetType().ToString() == "System.Web.UI.WebControls.Label")
  255:                                     {
  256:                                         Label l = (Label)control.Controls[0];
  257: 
  258:                                         switch (l.ID)
  259:                                         {
  260:                                             //case "inventoryProjectNameLabel": l.Text = Ia.Cl.Model.Nfc.Default.NfcProjectNameById(inventory.ProjectId); break;
  261:                                             //case "inventoryTypeNameLabel": l.Text = Ia.Cl.Model.Business.Nfc.Inventory.TypeNameByTypeId(inventory.ProjectId, inventory.TypeId); break;
  262:                                             //case "inventoryStateNameListLabel": l.Text = Ia.Cl.Model.Business.Nfc.Inventory.StateNameListByStateIdList(inventory.ProjectId, inventory.StateIdList); break;
  263:                                             //case "tagProjectNameLabel": l.Text = Ia.Cl.Model.Business.Nfc.Default.NfcProjectNameById(tag.ProjectId); break;
  264:                                             //case "tagTypeLabel": l.Text = Ia.Cl.Model.Business.Nfc.Tag.TypeNameById(tag.TypeId); break;
  265:                                             default: break;
  266:                                         }
  267:                                     }
  268:                                     else if (control.Controls[0].GetType().ToString() == "System.Web.UI.WebControls.HyperLink")
  269:                                     {
  270:                                         HyperLink hl = (HyperLink)control.Controls[0];
  271: 
  272:                                         switch (hl.ID)
  273:                                         {
  274:                                             case "reportServiceHyperLink":
  275:                                                 {
  276:                                                     s = string.Empty; // Ia.Ngn.Cl.Model.Business.Service.ServiceName(report.Service, report.ServiceType);
  277:                                                     hl.Text = s;
  278:                                                     hl.NavigateUrl = "/maintenance/find.aspx?input=" + s;
  279:                                                     break;
  280:                                                 }
  281:                                             default: break;
  282:                                         }
  283:                                     }
  284:                                     else if (control.Controls[0].GetType().ToString() == "System.Web.UI.WebControls.TextBox")
  285:                                     {
  286:                                         TextBox tb = (TextBox)control.Controls[0];
  287: 
  288:                                         switch (tb.ID)
  289:                                         {
  290:                                             case "staffEmploymentIdTextBox": tb.Text = string.Empty; break; // staff.EmploymentId.ToString(); break;
  291:                                             default: break;
  292:                                         }
  293:                                     }
  294:                                     else if (control.Controls[0].GetType().ToString() == "System.Web.UI.WebControls.DropDownList")
  295:                                     {
  296:                                         DropDownList ddl = (DropDownList)control.Controls[0];
  297: 
  298:                                         switch (ddl.ID)
  299:                                         {
  300:                                             case "staffAdministrativeFrameworkIdDropDownList":
  301:                                                 {
  302:                                                     //ddl.DataSource = Ia.Cl.Model.Data.Nfc.Tag.List();
  303:                                                     //ddl.DataValueField = "Id";
  304:                                                     //ddl.DataTextField = "FullyQualifiedArabicName";
  305:                                                     //ddl.DataBind();
  306: 
  307:                                                     //ddl.SelectedIndex = ddl.Items.IndexOf(ddl.Items.FindByValue(staff.AdministrativeFrameworkId.ToString()));
  308:                                                     break;
  309:                                                 }
  310: 
  311:                                             default: break;
  312:                                         }
  313:                                     }
  314:                                     else if (control.Controls[0].GetType().ToString() == "System.Web.UI.WebControls.CheckBox")
  315:                                     {
  316:                                         CheckBox cb = (CheckBox)control.Controls[0];
  317: 
  318:                                         switch (cb.ID)
  319:                                         {
  320:                                             case "staffIsHeadCheckBox": cb.Checked = true; break;// staff.IsHead; break;
  321:                                             default: break;
  322:                                         }
  323:                                     }
  324:                                     else if (control.Controls[0].GetType().ToString() == "System.Web.UI.WebControls.Image")
  325:                                     {
  326:                                         Image im = (Image)control.Controls[0];
  327: 
  328:                                         switch (im.ID)
  329:                                         {
  330:                                             case "nddOntPonOltOdfAccessVendorIconImage":
  331:                                                 {
  332:                                                     //vendor = (from o in Ia.Ngn.Cl.Model.Data.OntList where o.Id == nddOnt.Id select o.Pon.PonGroup.Olt.Odf.Vendor).SingleOrDefault();
  333:                                                     //vendor = nddOnt != null ? nddOnt.Pon.PonGroup.Olt.Odf.Vendor : null;
  334: 
  335:                                                     /*
  336:                                                     if (vendor != null)
  337:                                                     {
  338:                                                         im.ImageUrl = vendor.ImageUrl;
  339:                                                         im.ToolTip = vendor.Name;
  340:                                                     }
  341:                                                     * /
  342: 
  343:                                                     break;
  344:                                                 }
  345:                                             default: break;
  346:                                         }
  347:                                     }
  348:                                     else
  349:                                     {
  350: 
  351:                                     }
  352:                                 }
  353:                             }
  354:                             catch (Exception)
  355:                             {
  356:                             }
  357:                         }
  358:                     }
  359:                     else if (e.Row.RowType == DataControlRowType.Footer)
  360:                     {
  361:                     }
  362:                     else
  363:                     {
  364:                     }
  365:                 }
  366:                 else
  367:                 {
  368:                 }
  369:             }
  370:             else
  371:             {
  372:             }
  373:         }
  374:         */
  375:  
  376:         ////////////////////////////////////////////////////////////////////////////
  377:         ////////////////////////////////////////////////////////////////////////////
  378:     }
  379: }