示例#1
0
        public object DeleteTemplateType(TemplateTypeParam TP)
        {
            try
            {
                TblTemplateTypeMaster objmodule = db.TblTemplateTypeMasters.Where(r => r.TemplateTypeId == TP.TemplateTypeId).FirstOrDefault();

                if (objmodule.Status == 1)
                {
                    objmodule.Status = 0;
                }
                else
                {
                    objmodule.Status = 1;
                }

                db.SaveChanges();

                return(new Result()
                {
                    IsSucess = true, ResultData = "Template Type Updated Successfully!"
                });
            }
            catch (Exception ex)
            {
                return(new Error()
                {
                    IsError = true, Message = ex.Message
                });
            }
        }
        public object SaveTemplateType(TemplateTypeParam TP)
        {
            try
            {
                string msg = "";
                if (TP.BtnStatus == "Save")
                {
                    var usercode = db.TblTemplateTypeMasters.Where(r => r.TemplateType == TP.TemplateType.ToUpper()).FirstOrDefault();
                    if (usercode != null)
                    {
                        return(new Error()
                        {
                            IsError = true, Message = "Template Type Name is Already Exists!"
                        });
                    }
                    TblTemplateTypeMaster objTemplate = new TblTemplateTypeMaster();

                    objTemplate.TemplateType = TP.TemplateType.ToUpper();

                    objTemplate.CreatedBy   = TP.CreatedBy;
                    objTemplate.CreatedDate = DateTime.Now;

                    objTemplate.Status = 1;
                    db.TblTemplateTypeMasters.Add(objTemplate);
                    db.SaveChanges();
                    msg = "Template Type Saved Successfully!";
                }
                else
                {
                    TblTemplateTypeMaster objTempalte = db.TblTemplateTypeMasters.Where(r => r.TemplateTypeId == TP.TemplateTypeId).FirstOrDefault();
                    var Data = db.TblTemplateTypeMasters.Where(r => r.TemplateType == TP.TemplateType && r.TemplateTypeId == TP.TemplateTypeId).FirstOrDefault();
                    if (Data == null)
                    {
                        return(new Error()
                        {
                            IsError = true, Message = "Duplicate Entry Not Allowed"
                        });
                    }
                    objTempalte.TemplateType   = TP.TemplateType.ToUpper();
                    objTempalte.ModifiedBy     = TP.ModifiedBy;
                    objTempalte.ModifiedDate   = DateTime.Now;
                    objTempalte.TemplateTypeId = TP.TemplateTypeId;
                    db.SaveChanges();
                    msg = "Template Type Updated Successfully!";
                }

                return(new Result()
                {
                    IsSucess = true, ResultData = msg
                });
            }
            catch (Exception ex)
            {
                return(new Error()
                {
                    IsError = true, Message = ex.Message
                });
            }
        }
示例#3
0
 public object GetSingleTemplateType(TemplateTypeParam objgr)
 {
     try
     {
         var SingleModulelist = db.ViewTemplateTypes.Where(r => r.TemplateTypeId == objgr.TemplateTypeId).FirstOrDefault();
         return(SingleModulelist);
     }
     catch (Exception E)
     {
         return(new Error()
         {
             IsError = true, Message = E.Message
         });
     }
 }
示例#4
0
 public object DeleteTemplateType([FromBody] TemplateTypeParam MP)
 {
     try
     {
         TemplateTypeBL obj    = new TemplateTypeBL();
         var            result = obj.DeleteTemplateType(MP);
         return(result);
     }
     catch (Exception e)
     {
         return(new Error()
         {
             IsError = true, Message = e.Message
         });
     }
 }
示例#5
0
 public object GetSingleTemplateTypeInfo([FromBody] TemplateTypeParam OBJGR)
 {
     try
     {
         TemplateTypeBL obj      = new TemplateTypeBL();
         var            SingleGR = obj.GetSingleTemplateType(OBJGR);
         return(SingleGR);
     }
     catch (Exception ex)
     {
         return(new Error()
         {
             IsError = true, Message = ex.Message
         });
     }
 }
示例#6
0
 public object SaveTemplateType([FromBody] TemplateTypeParam PR)
 {
     try
     {
         TemplateTypeBL OBJSAVE = new TemplateTypeBL();
         var            result  = OBJSAVE.SaveTemplateType(PR);
         return(result);
     }
     catch (Exception e)
     {
         return(new Error()
         {
             IsError = true, Message = e.Message
         });
     }
 }
示例#7
0
        //public object GetModuleMaster([FromBody]ModuleParam objid)

        public object GetTemplateTypeMaster([FromBody] TemplateTypeParam objid)
        {
            try
            {
                var            status    = objid.Status;
                TemplateTypeBL obj       = new TemplateTypeBL();
                var            ERPModule = obj.GetTemplateTypeList(status);
                return(ERPModule);
            }
            catch (Exception ex)
            {
                return(new Error()
                {
                    IsError = true, Message = ex.Message
                });
            }
        }