Exemple #1
0
        private void btSave_FormSubmit(object sender, EventArgs e)
        {
            Trace.Write("btSave-UserId", UId.ToString());
            Trace.Write("btSave-SelectedValue",ddAssignTo.SelectedValue);

            SqlParameter[] parameters =
            {
                new SqlParameter("@OrgId",SqlDbType.Int,4,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,OrgId),
                new SqlParameter("@UID",SqlDbType.Int,4,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,UId),
                new SqlParameter("@EquipId",SqlDbType.Int,4,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,EquipId),
                new SqlParameter("@intAssignedTo",SqlDbType.Int,4,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,ddAssignTo.SelectedValue),
                new SqlParameter("@vchNote",SqlDbType.VarChar,250,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,tbNote.Text)
            };
            DbObject dbobj1 = new DbObject();
            dbobj1.intRunProcedure("sp_UpdateEquipAssignedTo",parameters);

            Response.Redirect(ParentPageURL);
        }
Exemple #2
0
        private void btSave_FormSubmit(object sender, EventArgs e)
        {
            EquipId=Convert.ToInt32(Request.QueryString["id"]);
            bool AddNew=false;
            if(EquipId==0){
                AddNew=true;
            }
            DbObject dbobj1 = new DbObject();
            SqlParameter[] parameters =
            {
                new SqlParameter("@Action",SqlDbType.Char,1,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,"U"),
                new SqlParameter("@OrgId",SqlDbType.Int,4,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,OrgId),
                new SqlParameter("@Id",SqlDbType.Int,4,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,EquipId),
                new SqlParameter("@TypeId",SqlDbType.Int,4,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,ddTypeId.SelectedValue),
                new SqlParameter("@MakeId",SqlDbType.Int,4,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,ddMakeId.SelectedValue),
                new SqlParameter("@ModelId",SqlDbType.Int,4,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,ddModelId.SelectedValue),
                new SqlParameter("@DeptId",SqlDbType.Int,4,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,ddDeptId.SelectedValue),
                new SqlParameter("@LocId",SqlDbType.Int,4,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,ddLocationId.SelectedValue),
                new SqlParameter("@intYear",SqlDbType.Int,4,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,tbYear.Text),
                new SqlParameter("@vchEquipId",SqlDbType.VarChar,25,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,tbEquipId.Text),
                new SqlParameter("@vchVinSerial",SqlDbType.VarChar,50,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,tbVinSerial.Text),
                new SqlParameter("@vchFuelCode",SqlDbType.VarChar,25,ParameterDirection.Input,false,0,0,null,DataRowVersion.Default,tbFuelCode.Text)
            };

            EquipId = dbobj1.intRunProcedure("sp_EquipEditDetail",parameters);

            if(ckReassign.Checked | AddNew==true){
                Response.Redirect("reassign.aspx?id="+EquipId+"");
                }
            else{
                Response.Redirect("view.aspx?id="+EquipId+"");
                }
        }