コード例 #1
0
        /// <summary>
        /// Save Data To Database
        /// <para>Use it when save data through a stored procedure</para>
        /// </summary>
        public int UpdateOrganogram(CmnOrganogram model)
        {
            GenericFactoryFor_Organogram = new vmCmnOrganogram_GF();
            int result = 0;

            try
            {
                Hashtable ht = new Hashtable();
                ht.Add("OrganogramID", model.OrganogramID);
                ht.Add("CustomCode", model.CustomCode);
                ht.Add("OrganogramName", model.OrganogramName);
                ht.Add("ParentID", model.ParentID);
                //ht.Add("IsCostCenter", model.IsCostCenter);
                //ht.Add("IsDefault", model.IsDefault);
                //ht.Add("StatusID", model.StatusID);
                ht.Add("CompanyID", model.CompanyID);
                ht.Add("CreateBy", model.CreateBy);
                ht.Add("CreateOn", DateTime.Now);
                ht.Add("CreatePc", HostService.GetIP());
                ht.Add("UpdateBy", 1);
                ht.Add("UpdateOn", DateTime.Now);
                ht.Add("UpdatePc", HostService.GetIP());
                ht.Add("IsDeleted", model.IsDeleted);
                ht.Add("DeleteBy", model.DeleteBy);
                ht.Add("DeleteOn", model.DeleteOn);
                ht.Add("DeletePc", model.DeletePc);
                string spQuery = "[Put_CmnOrganogram]";
                result = GenericFactoryFor_Organogram.ExecuteCommand(spQuery, ht);
            }
            catch (Exception e)
            {
                e.ToString();
            }
            return(result);
        }
コード例 #2
0
        public HttpResponseMessage UpdateOrganogram(CmnOrganogram model)
        {
            int result = 0;

            try
            {
                result = objOrgnagramService.UpdateOrganogram(model);
            }
            catch (Exception e)
            {
                e.ToString();
                result = -0;
            }

            return(Request.CreateResponse(HttpStatusCode.OK, result));
        }
コード例 #3
0
        public IHttpActionResult GetDepartmentByID(object[] data)
        {
            CmnOrganogram   SingleDept  = null;
            vmCmnParameters objcmnParam = JsonConvert.DeserializeObject <vmCmnParameters>(data[0].ToString());

            try
            {
                SingleDept = objCmnDDLService.GetDepartmentByID(objcmnParam);
            }
            catch (Exception e)
            {
                e.ToString();
            }

            return(Json(new
            {
                SingleDept
            }));
            //return objDOMaster.ToList();
        }