public ClsOrderCategory GetOrderCategoryById(long lgId)
        {
            ClsOrderCategory objClsOrderCategory = new ClsOrderCategory();

            try
            {
                using (this.objDataContext = new OrderCategoryDataContext(Functions.StrConnection))
                {
                    GetOrderCategoryByIdResult item = this.objDataContext.GetOrderCategoryById(lgId).ToList().FirstOrDefault();
                    if (item != null)
                    {
                        objClsOrderCategory.lgId    = item.Id;
                        objClsOrderCategory.strName = item.Name;
                    }
                }
            }
            catch (Exception ex)
            {
                Functions.Write(ex, System.Reflection.MethodBase.GetCurrentMethod().Name, PageMaster.OrderCategory, mySession.Current.UserId);
            }

            return(objClsOrderCategory);
        }
 public long SaveOrderCategory(ClsOrderCategory objSave)
 {
     try
     {
         using (TransactionScope scope = new TransactionScope())
         {
             using (this.objDataContext = new OrderCategoryDataContext(Functions.StrConnection))
             {
                 var result = this.objDataContext.InsertOrUpdateOrderCategory(objSave.lgId, objSave.strName, mySession.Current.UserId, objSave.blIsActive, PageMaster.OrderCategory.ToString().intSafe()).FirstOrDefault();
                 if (result != null)
                 {
                     objSave.lgId = result.InsertedId;
                 }
                 scope.Complete();
             }
             return(objSave.lgId);
         }
     }
     catch (Exception ex)
     {
         Functions.Write(ex, System.Reflection.MethodBase.GetCurrentMethod().Name, PageMaster.OrderCategory, mySession.Current.UserId);
         return(0);
     }
 }