protected void grdSponsor_SelectedIndexChanged(object sender, EventArgs e)
 {
     this.ddlSponsors.SelectedValue     = grdSponsor.SelectedRow.Cells[0].Text;
     this.txtBudget.Text                = grdSponsor.SelectedRow.Cells[2].Text;
     this.ddlCurrency.SelectedItem.Text = (grdSponsor.SelectedRow.Cells[3].Text == "") ? "--- Select Currency ---" : grdSponsor.SelectedRow.Cells[3].Text;
     this.txtFromDate.Text              = CheckNull.NullString(grdSponsor.SelectedRow.Cells[4].Text);
 }
示例#2
0
        public static bool Delete(string directory, bool isDeleteRoot = true)
        {
            CheckNull.ArgumentIsNullException(directory, nameof(directory));
            var flag        = false;
            var dirPathInfo = new DirectoryInfo(directory);

            if (dirPathInfo.Exists)
            {
                //删除目录下所有文件
                foreach (var fileInfo in dirPathInfo.GetFiles())
                {
                    fileInfo.Delete();
                }
                //递归删除所有子目录
                foreach (var subDirectory in dirPathInfo.GetDirectories())
                {
                    Delete(subDirectory.FullName);
                }
                //删除目录
                if (isDeleteRoot)
                {
                    dirPathInfo.Attributes = FileAttributes.Normal;
                    dirPathInfo.Delete();
                }
                flag = true;
            }
            return(flag);
        }
示例#3
0
 internal void DisposeInternal(int reference)
 {
     if (!CheckNull.IsNull(luaState))              //Fix submitted by Qingrui Li
     {
         LuaLib.LuaUnref(luaState, reference);
     }
 }
示例#4
0
        public static T HttpGet <T>(string url, Dictionary <string, string> postData = null, Dictionary <string, string> headers = null)
        {
            CheckNull.ArgumentIsNullException(url, nameof(url));
            var handler = new HttpClientHandler()
            {
                AutomaticDecompression = DecompressionMethods.None
            };

            using (var http = new HttpClient(handler))
            {
                if (headers != null)
                {
                    foreach (var header in headers)
                    {
                        http.DefaultRequestHeaders.Add(header.Key, header.Value);
                    }
                }
                if (postData != null)
                {
                    url = url + "?" + BuildParam(postData);
                }
                HttpResponseMessage response = http.GetAsync(url).Result;
                return(response.Content.ReadAsStreamAsync().Result.ToObject <T>());
            }
        }
示例#5
0
        public DbResult <bool> Auditin(long userId, long stockOutId)
        {
            var flag = _client.Ado.UseTran(() =>
            {
                //添加库存 如果有则修改 如果没有新增 添加库存明细
                var stockOutDetailList = _client.Queryable <Wms_stockoutdetail>().Where(c => c.StockOutId == stockOutId).ToList();
                var inventory          = new Wms_inventory();
                stockOutDetailList.ForEach(c =>
                {
                    var exist = _client.Queryable <Wms_inventory>().Where(i => i.MaterialId == c.MaterialId && i.StoragerackId == c.StoragerackId).First();
                    CheckNull.ArgumentIsNullException(exist, PubConst.StockOut1);
                    if (exist.Qty < c.ActOutQty)
                    {
                        CheckNull.ArgumentIsNullException(PubConst.StockOut2);
                    }
                    //update
                    exist.Qty          = exist.Qty - c.ActOutQty;
                    exist.ModifiedBy   = userId;
                    exist.ModifiedDate = DateTimeExt.DateTime;
                    _client.Updateable(exist);
                });

                //修改明细状态 2
                _client.Updateable(new Wms_stockoutdetail {
                    Status = StockInStatus.egis.ToByte(), AuditinId = userId, AuditinTime = DateTimeExt.DateTime, ModifiedBy = userId, ModifiedDate = DateTimeExt.DateTime
                }).UpdateColumns(c => new { c.Status, c.AuditinId, c.AuditinTime, c.ModifiedBy, c.ModifiedDate }).Where(c => c.StockOutId == stockOutId && c.IsDel == 1).ExecuteCommand();

                //修改主表中的状态改为进行中 2
                _client.Updateable(new Wms_stockout {
                    StockOutId = stockOutId, StockOutStatus = StockInStatus.egis.ToByte(), ModifiedBy = userId, ModifiedDate = DateTimeExt.DateTime
                }).UpdateColumns(c => new { c.StockOutStatus, c.ModifiedBy, c.ModifiedDate }).ExecuteCommand();
            });

            return(flag);
        }
示例#6
0
        public static string ToSha1(this string str)
        {
            CheckNull.ArgumentIsNullException(str, nameof(str));
            SHA1 shaM   = new SHA1Managed();
            var  result = shaM.ComputeHash(str.ToBytes());

            return(result.ToHexString());
        }
示例#7
0
 public static void Delete(string filePath)
 {
     CheckNull.ArgumentIsNullException(filePath, nameof(filePath));
     if (File.Exists(filePath))
     {
         File.Delete(filePath);
     }
 }
示例#8
0
        public static string ToMd52(this string str)
        {
            CheckNull.ArgumentIsNullException(str, nameof(str));
            var md5Hasher = new MD5CryptoServiceProvider();
            var data      = md5Hasher.ComputeHash(Encoding.UTF8.GetBytes(str));

            return(data.ToHexString());
        }
示例#9
0
    protected void btnPhonePlus_Click(object sender, EventArgs e)
    {
        lblStatusMessage.Text = "";
        DataTable tmpPhoneTbl = (DataTable)Session["PhoneTbl"];

        if (this.ddlPhoneType_Phone.SelectedIndex <= 0)
        {
            this.lblStatusMessage.Text = "फोनको किसिम छान्नुहोस";
            this.programmaticModalPopup.Show();
            return;
        }

        if (this.txtPhoneNumber_Phone.Text == "")
        {
            this.lblStatusMessage.Text = "फोन न. राख्नुहोस";
            this.programmaticModalPopup.Show();
            return;
        }

        if (grdPhone.SelectedIndex == -1)
        {
            DataRow row = tmpPhoneTbl.NewRow();
            row[1] = this.ddlPhoneType_Phone.SelectedValue;
            row[2] = this.ddlPhoneType_Phone.SelectedItem.ToString();
            row[3] = 0;
            row[4] = this.txtPhoneNumber_Phone.Text.Trim();
            row[5] = "Y";
            row[6] = "";
            row[7] = "A";
            tmpPhoneTbl.Rows.Add(row);
        }

        else
        {
            DataRow oldrow = tmpPhoneTbl.Rows[this.grdPhone.SelectedIndex];
            oldrow[1] = this.ddlPhoneType_Phone.SelectedValue;
            oldrow[2] = this.ddlPhoneType_Phone.SelectedItem.ToString();
            oldrow[4] = this.txtPhoneNumber_Phone.Text.Trim();
            oldrow[5] = "Y";
            oldrow[6] = "";
            if ((CheckNull.NullString(oldrow[7].ToString()) == "E") || (CheckNull.NullString(oldrow[7].ToString()) == ""))
            {
                oldrow[7] = "E";
            }
            else
            {
                oldrow[7] = "A";
            }
        }

        this.ddlPhoneType_Phone.SelectedIndex = 0;
        this.txtPhoneNumber_Phone.Text        = "";
        //this.txtPhoneRemarks.Text = "";
        this.grdPhone.DataSource = tmpPhoneTbl;
        this.grdPhone.DataBind();
        this.grdPhone.SelectedIndex = -1;
        //SetGridColor(7, 9, grdPhone);
    }
示例#10
0
    public static void Main(string[] args)
    {
        //Your code goes here
        DateTime?nullableDate = null;

        bool output = CheckNull.IsNullable(nullableDate);      // false

        Console.WriteLine(output);
    }
示例#11
0
 public static string GetMimeType(string extension)
 {
     CheckNull.ArgumentIsNullException(extension, nameof(extension));
     if (!extension.StartsWith("."))
     {
         extension = "." + extension;
     }
     return(_mappings.Value.TryGetValue(extension, out string mime) ? mime : "application/octet-stream");
 }
示例#12
0
 public static IServiceCollection AddOption <T>(this IServiceCollection services, string key, IConfiguration configuration) where T : class, new()
 {
     //if (key.IsEmpty())
     //{
     //    throw new ArgumentNullException(nameof(key));
     //}
     CheckNull.ArgumentIsNullException(key, nameof(key));
     return(services.AddOptions().Configure <T>(configuration?.GetSection(key)));
 }
 protected void grdWritSubCatSubTitle_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (CheckNull.NullString(this.grdWritSubCatSubTitle.SelectedRow.Cells[6].Text) == "")
     {
         this.grdWritSubCatSubTitle.SelectedRow.Cells[6].Text = "E";
     }
     this.txtWritSubCatSubTitle.Text          = this.grdWritSubCatSubTitle.SelectedRow.Cells[4].Text;
     this.chkWritSubCatSubTitleActive.Checked = (this.grdWritSubCatSubTitle.SelectedRow.Cells[5].Text == "Y") ? true : false;
 }
示例#14
0
    protected void btnEMailPlus_Click(object sender, EventArgs e)
    {
        lblStatusMessage.Text = "";
        DataTable tmpEMailTbl = (DataTable)Session["EMailTbl"];

        if (this.ddlEMailType_EMail.SelectedIndex <= 0)
        {
            this.lblStatusMessage.Text = "ईमेलको किसिम छान्नुहोस";
            this.programmaticModalPopup.Show();
            return;
        }

        if (this.txtEMail_EMail.Text == "")
        {
            this.lblStatusMessage.Text = "ईमेल ठेगाना राख्नुहोस";
            this.programmaticModalPopup.Show();
            return;
        }

        if (this.grdEMail.SelectedIndex == -1)
        {
            DataRow row = tmpEMailTbl.NewRow();
            row[1] = this.ddlEMailType_EMail.SelectedValue;
            row[2] = this.ddlEMailType_EMail.SelectedItem.ToString();
            row[3] = 0;
            row[4] = this.txtEMail_EMail.Text.Trim();
            row[5] = "Y";
            row[6] = "";
            row[7] = "A";
            tmpEMailTbl.Rows.Add(row);
        }
        else
        {
            DataRow oldrow = tmpEMailTbl.Rows[this.grdEMail.SelectedIndex];
            oldrow[1] = this.ddlEMailType_EMail.SelectedValue;
            oldrow[2] = this.ddlEMailType_EMail.SelectedItem.ToString();
            oldrow[4] = this.txtEMail_EMail.Text.Trim();
            oldrow[5] = "Y";
            oldrow[6] = "";
            if ((CheckNull.NullString(oldrow[7].ToString()) == "E") || (CheckNull.NullString(oldrow[7].ToString()) == ""))
            {
                oldrow[7] = "E";
            }
            else
            {
                oldrow[7] = "A";
            }
        }

        this.ddlEMailType_EMail.SelectedIndex = 0;
        this.txtEMail_EMail.Text = "";
        this.grdEMail.DataSource = tmpEMailTbl;
        this.grdEMail.DataBind();
        this.grdEMail.SelectedIndex = -1;
        //SetGridColor(7, 9, grdEMail);
    }
示例#15
0
 public static string ToSha512(this string str)
 {
     CheckNull.ArgumentIsNullException(str, nameof(str));
     using (var shaM = SHA512.Create())
     {
         //SHA512 shaM = new SHA512Managed();
         var result = shaM.ComputeHash(str.ToBytes());
         return(result.ToHexString());
     }
 }
    protected void btnAddSession_Click(object sender, EventArgs e)
    {
        if (this.txtSessionName.Text == "")
        {
            this.lblStatus.Text        = "Add Session Status";
            this.lblStatusMessage.Text = "Session Name Can't Be Left Blank";
            this.programmaticModalPopup.Show();
            return;
        }


        List <ATTSession> SessionLST = new List <ATTSession>();

        foreach (GridViewRow gvRow in grdSession.Rows)
        {
            SessionLST.Add(new ATTSession(
                               0, 0,
                               int.Parse(gvRow.Cells[0].Text),
                               CheckNull.NullString(gvRow.Cells[1].Text),
                               CheckNull.NullString(gvRow.Cells[2].Text),
                               CheckNull.NullString(gvRow.Cells[3].Text),
                               CheckNull.NullString(gvRow.Cells[2].Text),
                               CheckNull.NullString(gvRow.Cells[4].Text)
                               ));
        }


        if (grdSession.SelectedIndex == -1)
        {
            SessionLST.Add(new ATTSession(
                               0, 0,
                               0,
                               this.txtSessionName.Text,
                               this.txtSessionFromDate.Text,
                               this.txtTime.Text,
                               this.txtSessionFromDate.Text,
                               "A"));
        }
        else
        {
            SessionLST[grdSession.SelectedIndex].SessionName = this.txtSessionName.Text;
            SessionLST[grdSession.SelectedIndex].FromDate    = this.txtSessionFromDate.Text;
            SessionLST[grdSession.SelectedIndex].Time        = this.txtTime.Text;
            SessionLST[grdSession.SelectedIndex].Action      = (this.grdSession.SelectedRow.Cells[3].Text == "A") ? "A" : "E";
        }

        grdSession.DataSource = SessionLST;
        grdSession.DataBind();

        this.grdSession.SelectedIndex = -1;
        this.txtSessionName.Text      = "";
        this.txtTime.Text             = "";
        this.txtSessionFromDate.Text  = "";
    }
示例#17
0
        /// <summary>
        /// Gets the <see cref="bool"/> value with the specified key from the cache asynchronously or returns
        /// <c>null</c> if the key was not found.
        /// </summary>
        /// <param name="cache">The distributed cache.</param>
        /// <param name="key">The cache item key.</param>
        /// <returns>The <see cref="bool"/> value or <c>null</c> if the key was not found.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="cache"/> or <paramref name="key"/> is <c>null</c>.</exception>
        public static async Task <bool?> GetBooleanAsync(this IDistributedCache cache, string key)
        {
            CheckNull.ArgumentIsNullException(cache, nameof(cache));
            CheckNull.ArgumentIsNullException(cache, nameof(key));
            var bytes = await cache.GetAsync(key).ConfigureAwait(false);

            if (bytes == null)
            {
                return(null);
            }
            return(bytes.GetBinaryReader().ReadBoolean());
        }
示例#18
0
        public bool Auditin(long userId, long InventorymoveId)
        {
            var flag = _client.Ado.UseTran(() =>
            {
                var invmovedetailList = _client.Queryable <Wms_invmovedetail>().Where(c => c.InventorymoveId == InventorymoveId).ToList();
                var invmove           = _client.Queryable <Wms_inventorymove>().Where(c => c.InventorymoveId == InventorymoveId).First();
                invmovedetailList.ForEach(c =>
                {
                    var exist = _client.Queryable <Wms_inventory>().Where(i => i.MaterialId == c.MaterialId && i.InventoryBoxId == invmove.SourceInventoryBoxId).First();
                    CheckNull.ArgumentIsNullException(exist, PubConst.StockOut1);
                    if (exist.Qty < c.ActQty)
                    {
                        CheckNull.ArgumentIsNullException(PubConst.StockOut2);
                    }
                    //update
                    exist.Qty          = exist.Qty - (int)c.ActQty;
                    exist.ModifiedBy   = userId;
                    exist.ModifiedDate = DateTimeExt.DateTime;
                    _client.Updateable(exist).ExecuteCommand();
                    exist = _client.Queryable <Wms_inventory>().Where(i => i.MaterialId == c.MaterialId && i.InventoryBoxId == invmove.AimInventoryBoxId).First();
                    if (exist == null)
                    {
                        _client.Insertable(new Wms_inventory
                        {
                            InventoryBoxId = invmove.AimInventoryBoxId,
                            CreateBy       = userId,
                            InventoryId    = PubId.SnowflakeId,
                            MaterialId     = c.MaterialId,
                            Qty            = (int)c.ActQty,
                        }).ExecuteCommand();
                    }
                    else
                    {
                        exist.Qty         += (int)c.ActQty;
                        exist.ModifiedBy   = userId;
                        exist.ModifiedDate = DateTimeExt.DateTime;
                        _client.Updateable(exist).ExecuteCommand();
                    }
                });

                //修改明细状态 2
                _client.Updateable(new Wms_invmovedetail {
                    Status = StockInStatus.task_confirm.ToByte(), AuditinId = userId, AuditinTime = DateTimeExt.DateTime, ModifiedBy = userId, ModifiedDate = DateTimeExt.DateTime
                }).UpdateColumns(c => new { c.Status, c.AuditinId, c.AuditinTime, c.ModifiedBy, c.ModifiedDate }).Where(c => c.InventorymoveId == InventorymoveId && c.IsDel == 1).ExecuteCommand();

                //修改主表中的状态改为进行中 2
                _client.Updateable(new Wms_inventorymove {
                    InventorymoveId = InventorymoveId, Status = StockInStatus.task_confirm.ToByte(), ModifiedBy = userId, ModifiedDate = DateTimeExt.DateTime
                }).UpdateColumns(c => new { c.Status, c.ModifiedBy, c.ModifiedDate }).ExecuteCommand();
            }).IsSuccess;

            return(flag);
        }
示例#19
0
        public void Close()
        {
            if (_StatePassed)
            {
                return;
            }

            if (!CheckNull.IsNull(luaState))
            {
                LuaCore.LuaClose(luaState);
                ObjectTranslatorPool.Instance.Remove(luaState);
            }
        }
示例#20
0
 public static string ToMd5(this string str)
 {
     CheckNull.ArgumentIsNullException(str, nameof(str));
     using (var md5Hash = MD5.Create())
     {
         var data = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(str));
         //for (var i = 0; i < data.Length; i++)
         //{
         //    sBuilder.Append(data[i].ToString("x2"));
         //}
         return(data.ToHexString());
     }
 }
    protected void btnAddCourse_Click(object sender, EventArgs e)
    {
        if (this.txtCourseTitle.Text == "")
        {
            this.lblStatus.Text        = "Add Course Status";
            this.lblStatusMessage.Text = "Course Title Can't be Left Blank";
            this.programmaticModalPopup.Show();
            return;
        }

        List <ATTCourse> CourseLST = new List <ATTCourse>();

        foreach (GridViewRow gvRow in grdCourses.Rows)
        {
            CourseLST.Add(new ATTCourse(0, 0,
                                        CheckNull.NullintValue(gvRow.Cells[0].Text),
                                        gvRow.Cells[1].Text,
                                        CheckNull.NullString(gvRow.Cells[2].Text),
                                        CheckNull.NullString(gvRow.Cells[3].Text),
                                        CheckNull.NullString(gvRow.Cells[4].Text)
                                        ));
        }


        if (grdCourses.SelectedIndex == -1)
        {
            CourseLST.Add(new ATTCourse(0, 0, 0,
                                        this.txtCourseTitle.Text,
                                        this.txtCourseDescription.Text,
                                        (this.chkCourseActive.Checked == true) ? "Y" : "N",
                                        "A"
                                        ));
        }
        else
        {
            CourseLST[grdCourses.SelectedIndex].CourseTitle = this.txtCourseTitle.Text;
            CourseLST[grdCourses.SelectedIndex].Description = this.txtCourseDescription.Text;
            CourseLST[grdCourses.SelectedIndex].Active      = (this.chkCourseActive.Checked == true) ? "Y" : "N";
            CourseLST[grdCourses.SelectedIndex].Action      = (this.grdCourses.SelectedRow.Cells[4].Text == "A")?"A": "E";
        }

        grdCourses.SelectedIndex       = -1;
        this.txtCourseTitle.Text       = "";
        this.txtCourseDescription.Text = "";
        this.chkCourseActive.Checked   = false;

        this.grdCourses.DataSource = CourseLST;
        this.grdCourses.DataBind();
    }
示例#22
0
        /// <summary>
        ///根据生成的dll注册服务
        /// </summary>
        /// <param name="service">IServiceCollection</param>
        /// <param name="assemblyName">程序集的名称</param>
        /// <param name="injection">生命周期</param>
        public static void RegisterAssembly(IServiceCollection services, string assemblyName, ServiceLifetime injection = ServiceLifetime.Scoped)
        {
            CheckNull.ArgumentIsNullException(services, nameof(services));
            CheckNull.ArgumentIsNullException(assemblyName, nameof(assemblyName));
            var assembly = AssemblyLoadContext.Default.LoadFromAssemblyName(new AssemblyName(assemblyName));

            if (assembly.IsNullT())
            {
                throw new DllNotFoundException($"\"{assemblyName}\".dll不存在");
            }
            var types = assembly.GetTypes().Where(x => (typeof(IDependency).IsAssignableFrom(x)) &&
                                                  !x.IsInterface).ToList();

            //&& !o.Name.Contains("Base")
            foreach (var type in types)
            {
                var faces = type.GetInterfaces().Where(o => o.Name != "IDependency" && !o.Name.Contains("Base")).ToArray();
                if (faces.Any())
                {
                    var interfaceType = faces.LastOrDefault();//.FirstOrDefault();
                    switch (injection)
                    {
                    case ServiceLifetime.Scoped:
                        services.AddScoped(interfaceType, type);
                        if (faces.Count() > 2) //存在多个注册
                        {
                            services.AddScoped(faces[faces.Count() - 2], type);
                        }
                        break;

                    case ServiceLifetime.Singleton:
                        services.AddSingleton(interfaceType, type);
                        if (faces.Count() > 2)    //存在多个注册
                        {
                            services.AddScoped(faces[faces.Count() - 2], type);
                        }
                        break;

                    case ServiceLifetime.Transient:
                        services.AddTransient(interfaceType, type);
                        if (faces.Count() > 2)    //存在多个注册
                        {
                            services.AddScoped(faces[faces.Count() - 2], type);
                        }
                        break;
                    }
                }
            }
        }
    protected void grdWritSubCatTitle_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (CheckNull.NullString(this.grdWritSubCatTitle.SelectedRow.Cells[5].Text) == "")
        {
            this.grdWritSubCatTitle.SelectedRow.Cells[5].Text = "E";
        }
        this.txtWritSubCatTitle.Text          = this.grdWritSubCatTitle.SelectedRow.Cells[3].Text;
        this.chkWritSubCatTitleActive.Checked = (this.grdWritSubCatTitle.SelectedRow.Cells[4].Text == "Y") ? true : false;

        ATTWritSubject         WritSubjectOBJ = (ATTWritSubject)Session["TempWritSubject"];
        List <ATTWritCategory> WritSubCatLST  = WritSubjectOBJ.WritCategoryLST;


        this.grdWritSubCatSubTitle.DataSource = WritSubCatLST[this.grdWritCategory.SelectedIndex].WritCategoryTitleLST[this.grdWritSubCatTitle.SelectedIndex].WritCategorySubTitleLST;
        this.grdWritSubCatSubTitle.DataBind();
    }
示例#24
0
文件: Json.cs 项目: avalise/MyReps
        /// <summary>
        ///
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static string ToJsonL(this object obj)
        {
            var config = GlobalCore.GetRequiredService <JsonConfig>();

            CheckNull.ArgumentIsNullException(config, "请添加app.UseGlobalCore();services.AddJson();");
            switch (config.JsonType)
            {
            case JsonType.MessagePack:
                return(obj.MpToJson());

            case JsonType.ProtobufNet:
                throw new Exception("未实现");

            case JsonType.SimdJsonSharp:
                throw new Exception("未实现");

            case JsonType.SpanJson:
                throw new Exception("未实现");

            case JsonType.SwifterJson:
                if (config.SwifterJsonConfig.DateTimeFormat.IsEmpty())
                {
                    return(obj.SwifterToJson());
                }
                else
                {
                    return(obj.SwifterToJson(config.SwifterJsonConfig.DateTimeFormat, config.SwifterJsonConfig.JsonFormatterOptions));
                }

            case JsonType.Utf8Json:
                return(obj.Utf8JsonToJson());

            case JsonType.Jil:
                return(obj.JilToJson());

            case JsonType.ServiceStackText:
                throw new Exception("未实现");

            case JsonType.Newtonsoft:

                return(obj.ToJson(config.Newtonsoft.DateTimeFormat));

            default:
                return(obj.JilToJson());
            }
        }
示例#25
0
    protected void grdEMail_SelectedIndexChanged(object sender, EventArgs e)
    {
        GridViewRow row;

        if (this.grdEMail.SelectedIndex > -1)
        {
            if (this.grdEMail.Rows[this.grdEMail.SelectedIndex].Cells[7].Text != "D")
            {
                row = this.grdEMail.SelectedRow;
                this.ddlEMailType_EMail.SelectedValue = CheckNull.NullString(row.Cells[1].Text.ToString());
                this.txtEMail_EMail.Text = CheckNull.NullString(row.Cells[4].Text);
            }
            else
            {
                this.grdEMail.SelectedIndex = -1;
            }
        }
    }
示例#26
0
        void MakePropertyType()
        {
            if (MemberInfo.MemberType == MemberTypes.Property)
            {
                _PropertyType = (this.MemberInfo as PropertyInfo).PropertyType;
            }
            else if (MemberInfo.MemberType == MemberTypes.Field)
            {
                _PropertyType = (this.MemberInfo as FieldInfo).FieldType;
            }

            _nullable = this.PropertyType.FullName.StartsWith("System.Nullable`1");
            if (_nullable == false)
            {
                _NonullableType = _PropertyType;
            }
            else
            {
                _NonullableType = _PropertyType.GetGenericArguments()[0];
            }
            _nullChecker = CheckNull.GetChecker(_PropertyType);

            if (this._PropertyType.IsAssignableFrom(typeof(IEnumerable)))
            {
                foreach (var ifc in this._PropertyType.GetInterfaces())
                {
                    if (ifc.Name.StartsWith("System.IEnumerable"))
                    {
                        this._IsEnumerable = true;
                    }
                    else if (ifc.Name.StartsWith("System.IEnumerable<"))
                    {
                        this._EnumerableItemType = ifc.GetGenericArguments()[0];
                    }
                    else if (ifc.Name.StartsWith("System.IDictionary<"))
                    {
                        this._IsDictionary = true;
                        var kvts = ifc.GetGenericArguments()[0].GetGenericArguments();
                        this._DictionaryKeyType   = kvts[0];
                        this._DictionaryValueType = kvts[1];
                    }
                }
            }
        }
示例#27
0
    protected void grdPhone_SelectedIndexChanged(object sender, EventArgs e)
    {
        GridViewRow row;

        if (this.grdPhone.SelectedIndex > -1)
        {
            if (this.grdPhone.Rows[this.grdPhone.SelectedIndex].Cells[7].Text != "D")
            {
                row = this.grdPhone.SelectedRow;
                this.ddlPhoneType_Phone.SelectedValue = CheckNull.NullString(row.Cells[1].Text.ToString());
                this.txtPhoneNumber_Phone.Text        = CheckNull.NullString(row.Cells[4].Text);
                //this.txtPhoneRemarks.Text =   CheckNull.NullString(row.Cells[6].Text);
            }
            else
            {
                this.grdPhone.SelectedIndex = -1;
            }
        }
    }
示例#28
0
        public static string GetExtension(string mimeType, bool throwErrorIfNotFound)
        {
            CheckNull.ArgumentIsNullException(mimeType, nameof(mimeType));
            if (mimeType.StartsWith("."))
            {
                throw new ArgumentException("Requested mime type is not valid: " + mimeType);
            }

            if (_mappings.Value.TryGetValue(mimeType, out string extension))
            {
                return(extension);
            }
            if (throwErrorIfNotFound)
            {
                throw new ArgumentException("Requested mime type is not registered: " + mimeType);
            }
            else
            {
                return(string.Empty);
            }
        }
示例#29
0
        private PendingTransaction MapAceesData(OleDbDataReader reader)
        {
            PendingTransaction tran = new PendingTransaction();

            if (reader != null)
            {
                tran.TransactionUID                 = CheckNull.ConvertToInt32(reader["TransactionUID"]);
                tran.OpenClosedFlag                 = CheckNull.ConvertToString(reader["OpenClosedFlag"]);
                tran.TypeCode                       = CheckNull.ConvertToString(reader["TypeCode"]);
                tran.CededAssumedFlag               = CheckNull.ConvertToString(reader["CededAssumedFlag"]);
                tran.DisputedFlag                   = CheckNull.ConvertToString(reader["DisputedFlag"]);
                tran.Pre1984Flag                    = CheckNull.ConvertToString(reader["Pre1984Flag"]);
                tran.CnaReProductSw                 = CheckNull.ConvertToString(reader["CnaReProductSw"]);
                tran.ReinsurerCode                  = CheckNull.ConvertToString(reader["ReinsurerCode"]);
                tran.ContractCode                   = CheckNull.ConvertToString(reader["ContractCode"]);
                tran.SourceCode                     = CheckNull.ConvertToInt32(reader["SourceCode"]);
                tran.CompanyCode                    = CheckNull.ConvertToString(reader["CompanyCode"]);
                tran.TableUID                       = CheckNull.ConvertToShort(reader["TableUID"]);
                tran.APFlag                         = CheckNull.ConvertToString(reader["APFlag"]);
                tran.NICOOffsetFlag                 = CheckNull.ConvertToString(reader["NICOOffsetFlag"]);
                tran.OriginalReinsurerCode          = CheckNull.ConvertToString(reader["OriginalReinsurerCode"]);
                tran.ContractCodeFAC                = CheckNull.ConvertToString(reader["ContractCodeFAC"]);
                tran.ContractUnderwritingYear       = CheckNull.ConvertToShort(reader["ContractUnderwritingYear"]);
                tran.ContractLayerEffectiveDate     = CheckNull.ConvertToDateTime(reader["ContractLayerEffectiveDate"]);
                tran.ContractLayerNumber            = CheckNull.ConvertToShort(reader["ContractLayerNumber"]);
                tran.CatastropheCode                = CheckNull.ConvertToString(reader["CatastropheCode"]);
                tran.LocationCodePart6              = CheckNull.ConvertToString(reader["LocationCodePart6"]);
                tran.CollateralDeferralEndDate      = CheckNull.ConvertToDateTime(reader["CollateralDeferralEndDate"]);
                tran.CertifiedRatingEffDt           = CheckNull.ConvertToDateTime(reader["CertifiedRatingEffDt"]);
                tran.CertifiedRecoRatingCd          = CheckNull.ConvertToString(reader["CertifiedRecoRatingCd"]);
                tran.CertifiedPercent               = CheckNull.ConvertToDouble(reader["CertifiedPercent"]);
                tran.OrigReinsCollateDeferralEndDt  = CheckNull.ConvertToDateTime(reader["OrigReinsCollateDeferralEndDt"]);
                tran.OrigReinsCertifiedRatingEffDt  = CheckNull.ConvertToDateTime(reader["OrigReinsCertifiedRatingEffDt"]);
                tran.OrigReinsCertifiedRecoRatingCd = CheckNull.ConvertToString(reader["OrigReinsCertifiedRecoRatingCd"]);
                tran.OrigReinsCertifiedPercent      = CheckNull.ConvertToInt32(reader["OrigReinsCertifiedPercent"]);
                tran.MultipleBeneficiaryAmt         = CheckNull.ConvertToDecimal(reader["MultipleBeneficiaryAmt"]);
            }

            return(tran);
        }
示例#30
0
        void MakePropertyType()
        {
            if (MemberInfo.MemberType == MemberTypes.Property)
            {
                _PropertyType = (this.MemberInfo as PropertyInfo).PropertyType;
            }
            else if (MemberInfo.MemberType == MemberTypes.Field)
            {
                _PropertyType = (this.MemberInfo as FieldInfo).FieldType;
            }

            _nullable = this.PropertyType.FullName.StartsWith("System.Nullable`1");
            if (_nullable == false)
            {
                _NonullableType = _PropertyType;
            }
            else
            {
                _NonullableType = _PropertyType.GetGenericArguments()[0];
            }
            _nullChecker = CheckNull.GetChecker(_PropertyType);
        }