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

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

    1: using System;
    2: using System.Configuration;
    3:  
    4: namespace Ia.TentPlay.Wa.Models.Ui
    5: {
    6:     ////////////////////////////////////////////////////////////////////////////
    7:  
    8:     /// <summary publish="true">
    9:     ///
   10:     /// </summary>
   11:     /// 
   12:     /// <remarks> 
   13:     /// Copyright © 2006-2025 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   14:     ///
   15:     /// 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
   16:     /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   17:     ///
   18:     /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   19:     /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   20:     /// 
   21:     /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
   22:     /// 
   23:     /// Copyright notice: This notice may not be removed or altered from any source distribution.
   24:     /// </remarks> 
   25:     public abstract class Default
   26:     {
   27:         ////////////////////////////////////////////////////////////////////////////
   28:  
   29:         /// <summary>
   30:         ///
   31:         /// </summary>
   32:         public Default()
   33:         {
   34:         }
   35:  
   36:         ////////////////////////////////////////////////////////////////////////////
   37:  
   38:         /// <summary>
   39:         ///
   40:         /// </summary>
   41:         public static string MailTop()
   42:         {
   43:             return @"
   44: <!doctype html>
   45: <html lang=""en"">
   46: <head>
   47:     <meta charset=""utf-8"">
   48:     <meta name=""viewport"" content=""width=device-width, initial-scale=1"">
   49: <title>" + Ia.Cl.Models.ApplicationConfiguration.GetSetting("AppSettings:SiteName") + ": " + Ia.Cl.Models.ApplicationConfiguration.GetSetting("AppSettings:CompanyName") + @"</title>
   50: <link rel=""icon"" type=""image/x-icon"" href=""/image/logo.ico"" />
   51: <style>
   52: html { direction:ltr; }
   53: body { background:#fff;margin:5px;padding:0px;color:DarkBlue; }
   54: body,td,th,a,input.button_ia,input,textarea,option,select,pre { font:9pt normal #000066 ""Tahoma"";font-family:Tahoma;text-decoration:none; }
   55: a:link { color:#0000ff;text-decoration:none; }
   56: a:visited { color:#0000ff;text-decoration:none; }
   57: a:hover { color:#ff8888;text-decoration:none; }
   58: hr { color:rgb(204,204,204); }
   59: p { line-height:18px;margin-top:9px;margin-bottom:9px; }
   60: table.form { }
   61: table.form td { }
   62: </style>
   63: </head>
   64: <body>
   65:  
   66: <p><b>" + Ia.Cl.Models.ApplicationConfiguration.GetSetting("AppSettings:SiteName") + "</b>: <b>" + Ia.Cl.Models.ApplicationConfiguration.GetSetting("AppSettings:CompanyName") + @"</b></p>
   67: ";
   68:         }
   69:  
   70:         ////////////////////////////////////////////////////////////////////////////
   71:  
   72:         /// <summary>
   73:         ///
   74:         /// </summary>
   75:         public static string PlainMailTop()
   76:         {
   77:             return Ia.Cl.Models.ApplicationConfiguration.GetSetting("AppSettings:SiteName") + ": " + Ia.Cl.Models.ApplicationConfiguration.GetSetting("AppSettings:CompanyName") + @"
   78: ";
   79:         }
   80:  
   81:         ////////////////////////////////////////////////////////////////////////////
   82:  
   83:         /// <summary>
   84:         ///
   85:         /// </summary>
   86:         public static string MailBottom()
   87:         {
   88:             return @"
   89: </body>
   90: </html>
   91: ";
   92:         }
   93:  
   94:         ////////////////////////////////////////////////////////////////////////////
   95:  
   96:         /// <summary>
   97:         ///
   98:         /// </summary>
   99:         public static string PlainMailBottom()
  100:         {
  101:             return @"";
  102:         }
  103:  
  104:         /*
  105:         ////////////////////////////////////////////////////////////////////////////
  106: 
  107:         /// <summary>
  108:         ///
  109:         /// </summary>
  110:         public static void ProfileRepeater_ItemDataBound(System.Web.UI.Page page, object sender, RepeaterItemEventArgs e)
  111:         {
  112:             ListItemType itemType = e.Item.ItemType;
  113: 
  114:             if (itemType == ListItemType.Item || itemType == ListItemType.AlternatingItem)
  115:             {
  116:                 Ia.Wa.Models.Data.Portfolio portfolio = (Ia.Wa.Models.Data.Portfolio)e.Item.DataItem;
  117: 
  118:                 for (int i = 0; i < e.Item.Controls.Count; i++)
  119:                 {
  120:                     try
  121:                     {
  122:                         if (e.Item.Controls[i].GetType().ToString() == "System.Web.UI.WebControls.Label")
  123:                         {
  124:                             Label l = (Label)e.Item.Controls[i];
  125: 
  126:                             if (l.ID == "titleLabel") l.Text = portfolio.Title;
  127:                             else if (l.ID == "descriptionLabel") l.Text = portfolio.Description;
  128:                             else if (l.ID == "technologyLabel") l.Text = portfolio.Technology;
  129:                         }
  130:                         else if (e.Item.Controls[i].GetType().ToString() == "System.Web.UI.WebControls.HyperLink")
  131:                         {
  132:                             System.Web.UI.WebControls.HyperLink hl = (System.Web.UI.WebControls.HyperLink)e.Item.Controls[i];
  133: 
  134:                             if (hl.ID == "navigateUrlHyperLink")
  135:                             {
  136:                                 hl.NavigateUrl = "~/service/winform.aspx";
  137:                                 hl.BorderWidth = 0;
  138:                                 hl.Text = hl.ToolTip = portfolio.Title;
  139:                             }
  140:                         }
  141:                         else if (e.Item.Controls[i].GetType().ToString() == "System.Web.UI.WebControls.Image")
  142:                         {
  143:                             System.Web.UI.WebControls.Image im = (System.Web.UI.WebControls.Image)e.Item.Controls[i];
  144: 
  145:                             if (im.ID == "captureImage")
  146:                             {
  147:                                 im.ImageUrl = portfolio.CaptureImage;
  148:                                 im.BorderWidth = 0;
  149:                                 im.AlternateText = im.ToolTip = portfolio.Title;
  150:                             }
  151:                         }
  152:                     }
  153:                     catch { }
  154:                 }
  155:             }
  156:         }
  157: 
  158:         ////////////////////////////////////////////////////////////////////////////
  159: 
  160:         /// <summary>
  161:         ///
  162:         /// </summary>
  163:         public static void NamespaceRepeater_ItemDataBound(System.Web.UI.Page page, object sender, RepeaterItemEventArgs e)
  164:         {
  165:             ListItemType itemType = e.Item.ItemType;
  166: 
  167:             if (itemType == ListItemType.Item || itemType == ListItemType.AlternatingItem)
  168:             {
  169:                 Ia.Cl.Models.Data.CodeLibrary codeLibrary = (Ia.Cl.Models.Data.CodeLibrary)e.Item.DataItem;
  170: 
  171:                 for (int i = 0; i < e.Item.Controls.Count; i++)
  172:                 {
  173:                     try
  174:                     {
  175:                         if (e.Item.Controls[i].GetType().ToString() == "System.Web.UI.WebControls.Label")
  176:                         {
  177:                             Label l = (Label)e.Item.Controls[i];
  178: 
  179:                             if (l.ID == "classNameLabel") l.Text = codeLibrary.ClassName;
  180:                             else if (l.ID == "namespaceLabel") l.Text = codeLibrary.Namespace;
  181:                             else if (l.ID == "summaryLabel") l.Text = codeLibrary.Summary;
  182:                         }
  183:                         else if (e.Item.Controls[i].GetType().ToString() == "System.Web.UI.WebControls.HyperLink")
  184:                         {
  185:                             System.Web.UI.WebControls.HyperLink hl = (System.Web.UI.WebControls.HyperLink)e.Item.Controls[i];
  186: 
  187:                             if (hl.ID == "codeFileHyperLink")
  188:                             {
  189:                                 hl.NavigateUrl = "~/library/" + codeLibrary.Namespace.ToLower() + "." + codeLibrary.ClassName.ToLower() + ".aspx";
  190:                                 hl.BorderWidth = 0;
  191:                                 hl.Text = hl.ToolTip = codeLibrary.ClassName + " (" + codeLibrary.Namespace + ")";
  192:                             }
  193:                         }
  194:                     }
  195:                     catch { }
  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.Models.Nfc.Inventory inventory;
  211:             //Ia.Cl.Models.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.Models.Nfc.Inventory);
  227:                             break;
  228:                         }
  229:                     case "tagGridView":
  230:                         {
  231:                             //tag = (e.Row.DataItem as Ia.Cl.Models.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.Models.Nfc.Default.NfcProjectNameById(inventory.ProjectId); break;
  261:                                             //case "inventoryTypeNameLabel": l.Text = Ia.Cl.Models.Business.Nfc.Inventory.TypeNameByTypeId(inventory.ProjectId, inventory.TypeId); break;
  262:                                             //case "inventoryStateNameListLabel": l.Text = Ia.Cl.Models.Business.Nfc.Inventory.StateNameListByStateIdList(inventory.ProjectId, inventory.StateIdList); break;
  263:                                             //case "tagProjectNameLabel": l.Text = Ia.Cl.Models.Business.Nfc.Default.NfcProjectNameById(tag.ProjectId); break;
  264:                                             //case "tagTypeLabel": l.Text = Ia.Cl.Models.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.Models.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.NetworkDesignDocument.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: }